Cout statement???? | Sololearn: Learn to code for FREE!
Новый курс! Каждый программист должен знать генеративный ИИ!
Попробуйте бесплатный урок

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.

23rd Jul 2020, 9:02 AM
3 ответов
+ 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ï - avatar
Thank to all, helpers.
23rd Jul 2020, 9:21 AM
- 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