Skip to main content
Write a program to display all the even numbers and odd numbers between 1 and 100 using do while loop.
Write a program to display all the even numbers and odd numbers between 1 and 100 using do while loop.
#include <iostream>
using namespace std;
int main(){
int a = 1, b = 200;
do{
cout
<< a << endl;
a++;
} while (a <= 100);
do {
cout
<< b << endl;
b++;
} while (b <= 250);
system("pause");
return 0;
}
Comments
Post a Comment