Min-Jee Banzali Ü
Huwebes, Oktubre 13, 2011
Problem number 3 ( Iterative Statements )
Write a program that asks the user to enter a number n and display the first even numbers. Example: if n=5, the first 5 even numbers are 2, 4, 6, 8 and 10.
#include<stdio.h>
#include<conio.h>
#define min printf
#define jee scanf
int main()
{
int m, j;
min(
"Enter a number: "
);
jee(
"%d"
,&j);
for ( m =
0
; m <= j*2; m+=
2
)
min(
"%d\n"
,m);
getch ();
return 0;
}
Sample Output:
▌▌▌Ü ▌▌▌
Walang komento:
Mag-post ng isang Komento
Mas Bagong Post
Mga Lumang Post
Home
Mag-subscribe sa:
I-post ang Mga Komento (Atom)
Walang komento:
Mag-post ng isang Komento