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
0
Because you have initialized a=1 therefore it's displaying 1 and waiting for getting next input
0
I tried to only declare 'a' and input a value >9 and the output was 0.