+ 1

Why does my code take integer 8 as default when no number in entered through cin.

This is happening in code playground. So pls check the code there and here is code :- #include <iostream> using namespace std; int main(){ int x, y, z; /* For single input */ cin >> x; cout << "Enter a number: " << x << endl; /* For multiple inputs*/ cout << "Enter 2 numbers: "; cin >> y >> z; cout << "Sum = " << (x+y+z); return 0; }

22nd Jun 2019, 6:13 AM
BoiCoded
1 Respuesta