do while odd numbers

Program to generate series of Odd numbers between 1 to 100

 

 

#include <iostream.h>

#include <conio.h>

int main()

{

int a=1; 

do

{

if (a%2!=0)

cout<<a<<"\t";

a++;

}

while (a<=100)

getch();

return 0;

}

No comments :

Post a Comment