C++ program to find odd numbers between 1 to 100
// In this C++ program the for loop is generating a number from 1 to 100
// and increment by 1. In loop the program will check each number whether
// it is odd or not by taking a%2!=0. If result of a mod 2 is not equals to 0
// means number is odd 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();
}
Feb 27, 2007
C++ program to find odd numbers between 1 to 100
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment