Monday, October 1, 2012

C++ - To print 100 odd numbers

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

0 comments:

Post a Comment