PHP Programs

Please click on 1-2 Ads to keep this website's Study Material FREE and regularly Updated.

Program 14: Write a PHP program using a loop to add all the integers 0 and 35 and display the sum.


<!DOCTYPE html>
	<title>PHP Programs</title>
	$sum = 0;

	for($num =1; $num<=35; $num++)
		$sum +=$num;

	echo "The sum of the numbers 0 to 35 is $sum"."\n";

If you have any suggestion or found any error in the above program, then do let us know at [email protected] or just comment below.