can you give me a code for when i input a lower %26amp; upper limit number the results are all even number. For example, I input 1 as lower %26amp; 9 as upper number,the the result is 2 4 6 8?How can i make a program that the output are even numbers?
I'm pretty sure I've answered this already tonight... but -%26gt;
for (x = lower; x %26lt;= upper; x++)
{
if (x % 2 == 0) print x;
}
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment