Create a script using a for loop to add all the integers between 0 and 30 and display the sum
- برمجة بي اتش بي
- 2021-09-09
- mhanasmh00489829403
الأجوبة
<?php
$sum = 0;
for($x=1; $x<=30; $x++)
{
$sum +=$x;
}
echo "The sum of the numbers 0 to 30 is $sum"."\n";
?>
Sample Output:
The sum of the numbers 0 to 30 is 465
أسئلة مشابهة
القوائم الدراسية التي ينتمي لها السؤال