<?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
Write a PHP script that parses JSON data and displays specific information. |
Write a PHP script that generates a random password of a specified length. |
Write a PHP script that checks if a given string is a valid email address. |
How to prevent SQL Injection using php |
how can i solve php header errors? |
Create a PHP script that processes a form submission and displays the submitted data. |
how to get country, state and city select option using google map api in php |
How to convert a temperature from Celsius to Fahrenheit using php. |
