first 50 even numbers using loop

C, C++, etc Programing examples. Post as many you can. Test the programs and discuss about the output of the programes.
Forum rules
Please Discuss & post only about the programes and its Output

first 50 even numbers using loop

Postby kantisuthar » Sun Apr 17, 2011 2:16 pm

/* Program to display first 50 even numbers*/
#include<stdio.h>
#include<conio.h>
void main()
{
int i,n=2;
clrscr();
for (i=1;i<=50;i++)
{
printf("%d\t",n);
n+=2;
}
getch();
}
kantisuthar
Registered User
 
Posts: 6
Joined: Thu Apr 14, 2011 7:22 pm
membership: Associate Member of The Institution of Engineers (India)- AMIE

ad
 

Return to Computer Notes : Some Sample Programs

Who is online

Users browsing this forum: No registered users and 1 guest