0
How can do "do while' in c++ of this code.
Initial value of a is 0. It should print upto 5(a<=5). https://code.sololearn.com/cIMmud6NXEYf/?ref=app
3 odpowiedzi
0
You are missing a semi colon in
int a=0 ;
And add print statement in loop
cout << a;
+ 2
#include <iostream>
using namespace std;
int main() {
int a = 0;
do{
a++;
cout<<a<<endl;
} while (a<5);
return 0;
}
0
Thanks, Worked