Pls i need help in how to output even numbers from 2- 18 using the while statement(loop)
This is our assignment, i've researched about "while" but i still could'nt get the structure.
pls anyone help me!!!
I'm using "C"
Printable View
Pls i need help in how to output even numbers from 2- 18 using the while statement(loop)
This is our assignment, i've researched about "while" but i still could'nt get the structure.
pls anyone help me!!!
I'm using "C"
You can fill in the rest, but here's the basic structure. Don't want to do everything for you after all ;)
Code:#include <stdio.h>
int main(void)
{
// Declare and initialize num variable here
while(num <= 18)
{
// Print the number
// Add 2 to the number
}
return 0;
}
gee thanks! 4 the structure! I'm still trying to learn C. we've just started programming today so it's my first time. BASIC