Create a script that usesa while statement that increments through and prints every even number between 1 and 49.

Can any one do that for me?!?

nav33n commented: Read the guidelines 'carefully'. -2

Recommended Answers

All 2 Replies

Create a script that usesa while statement that increments through and prints every even number between 1 and 49.

Can any one do that for me?!?

No, in case you missed the signs, rules, signatures and giant bold text everywhere, we don't do your homework for you.

<?php
while ($i<50) {
	$result=$i%2;
		if ($result==0) {
			echo "$i";
			echo "<br>";
		}
	$i=$i+1;
}					
?>
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.