<?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 counts the number of occurrences of each word in a given sentence. |
How to prevent SQL Injection using php |
Create a PHP script that calculates and displays the area of a rectangle given its length and width. |
Create a PHP script that checks whether a given number is a prime number or not. |
Write a PHP script that generates and displays a list of the first 10 Fibonacci numbers. |
how to get current latitude and longitude using google map api in php? |
Create a PHP script that processes a form submission and displays the submitted data. |
How to reverses a given string using PHP. |
