// and increment by 1. In loop the program will check each number whether
// it is even or not by taking a%2==0. If result of a mod 2 is equals to 0
// means number is even and it will get printed by cout statement
#include<iostream.h>
#include<conio.h>
main()
{
clrscr();
int a;
for (a=1;a<=100;a++)
{
if (a%2!=0)
{
cout << a <<endl;
}
}
getch();
}
No comments:
Post a Comment