<?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
Write a PHP function to check if a given string is a palindrome |
How to get the largest element in an array of numbers |
Create a PHP script that prints the current date and time. |
Create a PHP script that checks whether a given number is a prime number or not. |
what is PhpUnit? |
How to call travelport catalogproductofferings api using php? |
how to get current lat and lng from ip address using google map api in php? |
Write a PHP script that calculates the factorial of a given number using an iterative approach. |