0
Why is this code bringing 1as the output??
#include <iostream> using namespace std; int main() { int a; a=1; do { cout << a << endl; cin>> a; a++; } while(a <= 9); return 0; }
2 Answers
+ 2
Because variable a intialized in 1 and its value outputs first.
The code outputs 1 and waits for user input.
Enter any number to continue execution.
0
Thanks