<?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 whether a given year is a leap year using php. |
Create a PHP script that processes a form submission and displays the submitted data. |
Create a PHP function to count the number of vowels in a string. |
how to get response status in api using curl php? |
How to reverses a given string using PHP. |
How to convert a temperature from Celsius to Fahrenheit using php. |
Write a PHP script that calculates the factorial of a given number using an iterative approach. |
How to call travelport catalogproductofferings api using php? |
