- 1
How to print out odd numbers from 0-50
5 Answers
+ 11
for (int i = 1; i < 50; i += 2)
{
cout << i << endl;
}
+ 4
int x=0;
while(x<=50)
{
cout << x << endl;
x++;
}
+ 2
int i=0;
do {
if(i%2==1) cout <<i <<endl;
} while (++i <50);
0
#include <iostream>
using namespace std;
int main()
{
int x = 1;
while (x<=50){
cout <<"Number"<<x<<endl;
x=x+2;
}
return 0;
}