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"
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"
Last edited by tatsume05; 07-17-2006 at 09:44 AM.
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; }
If you understand what you're doing, you're not learning anything.
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