#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int a=1 , b=500; //you can extend this range i.e b=1000
cout<<"\n\n---------------------\n";
cout<<" Odd Numbers \n";
cout<<"---------------------\n\n";
while(a<=b)
{
if(a%2!=0)
cout<<a<<" ,";
a++;
}
getche() ;
}
#include<conio.h>
void main()
{
clrscr();
int a=1 , b=500; //you can extend this range i.e b=1000
cout<<"\n\n---------------------\n";
cout<<" Odd Numbers \n";
cout<<"---------------------\n\n";
while(a<=b)
{
if(a%2!=0)
cout<<a<<" ,";
a++;
}
getche() ;
}
No comments:
Post a Comment