<?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
what is PhpUnit? |
how to get response status in api using curl php? |
Create a PHP script that calculates and displays the area of a rectangle given its length and width. |
how to get current lat and lng from ip address using google map api in php? |
Create a PHP script that processes a form submission and displays the submitted data. |
How to check if a given number is a perfect number. |
Create a PHP function to count the number of vowels in a string. |
Write a PHP script that parses JSON data and displays specific information. |
