<?php
$sum = 0;
for ($i = 2; $i <= 10; $i += 2) {
$sum += $i;
}
echo "The sum of even numbers between 1 and 10 is: $sum";
?>
<?php
$sum = 0;
for ($i = 2; $i <= 10; $i += 2) {
$sum += $i;
}
echo "The sum of even numbers between 1 and 10 is: $sum";
?>
Related
How to show location using google map in JavaScript? |
Write a PHP script that connects to a MySQL database and fetches data from a table. |
how can i solve php header errors? |
How to call travelport catalogproductofferings api using php? |
Write a PHP script that sets a cookie with user preferences and retrieves it on subsequent visits. |
Write a PHP script that checks if a given string is a valid email address. |
Write a PHP script that generates and displays a simple multiplication table for the numbers 1 to 5. |
Create a PHP function to count the number of vowels in a string. |