<?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 prevent SQL Injection using php |
Create a PHP script that checks whether a given number is a prime number or not. |
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. |
Create a PHP script that prints the current date and time. |
How to convert a temperature from Celsius to Fahrenheit using php. |
How to show location using google map in JavaScript? |
How to get the largest element in an array of numbers |
