<?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
Create a PHP script that calculates and displays the area of a rectangle given its length and width. |
Write a PHP script that generates a random password of a specified length. |
Write a PHP script that calculates the factorial of a given number using an iterative approach. |
Write a PHP script that generates and displays a list of the first 10 Fibonacci numbers. |
Create a PHP script that prints the current date and time. |
how can i solve php header errors? |
How to show location using google map in JavaScript? |
How to get the largest element in an array of numbers |
