HomePHP Write a PHP script using a for loop to add all the integers between 0 and 20 and display the sum Vikram somai September 24, 2021 0 Comments Facebook Twitter code:- <?php$sum = 0;for($x=1; $x<=20; $x++){$sum +=$x;}echo "The sum of the numbers 0 to 20 => $sum";?>output:-The sum of the numbers 0 to 20 => 210 Tags PHP Facebook Twitter
Post a Comment
If you have any doubts, Please let me know
Thanks!