<?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 check if a given number is a perfect number. |
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. |
Write a PHP script that parses JSON data and displays specific information. |
Write a PHP function to check if a given string is a palindrome |
Create a PHP script that uses sessions to store and display user information. |
how to get current latitude and longitude using google map api in php? |
Create a PHP script that prints the current date and time. |