0
Cout statement????
I want to write down all multiples of number3 between 0 to 100. I have already writen the code. But here is the program because I don't know how to write the proper (right) Cout statement and where to insert it in the code. So will all multiples be written in one line, as a result. https://code.sololearn.com/c0wT0G57SLVw/?ref=app
3 Antworten
+ 1
#include <iostream>
using namespace std;
int main() {
int a=1;
do{
if (a%3==0)
cout <<a<<" ";
a++;
}while (a<100);
return 0;
}
Marjan try this
0
Thank to all, helpers.
- 1
First of all from your code place cout statement out of the do condition and place just before while and then run.Although your program is not seeming correct.