Monday, October 1, 2012

C++ - To print first 100 even numbers

#include<iostream.h>
#include<conio.h>
int main(void)
{
  int i;
  cout<<"First 100 natural even numbers are : \t";
for(i=1; i<200; i++)
{
      if(i%2==0)
cout<<i<<"\t";
}
getch();
return 0;
}

0 comments:

Post a Comment