+ 1
[ASSIGNMENT] Write the program in c++ to find the odd no. b/w 1 to 100
5 Answers
+ 7
for(int a=0;a<=100;a++){
if (a%2==0){
continue;
}
cout<<a;
}
+ 5
for (int i=1; i<=100; std::cout<<i<<" ", i+=2);
+ 3
for(int i = 1; i <= 100; i++)
{
if(i%2!=0)
cout >> i;
}
0
//using a while loop
int b=1;
while (b<100){
b++;
if (b%2==0){
continue;
}
cout<<b<<endl;
}