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

23rd Jul 2020, 9:02 AM
TeaserCode
3 Respostas
+ 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
23rd Jul 2020, 9:19 AM
Sâgærāvürï
Sâgærāvürï - avatar
0
Thank to all, helpers.
23rd Jul 2020, 9:21 AM
TeaserCode
- 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.
23rd Jul 2020, 1:03 PM
shubham kumar
shubham kumar - avatar