<?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 get current lat and lng from ip address using google map api in php? |
How to check whether a given year is a leap year using php. |
Write a PHP script that generates and displays a simple multiplication table for the numbers 1 to 5. |
Create a PHP script that prints the current date and time. |
Write a PHP function that throws a custom exception if a condition is not met. |
Create a PHP function to count the number of vowels in a string. |
what is PhpUnit? |
How to call travelport catalogproductofferings api using php? |
