0
Please who can correct this code?
#include <iostream> using namespace std; int main() { int b; cout <<"enter a number\n"; cin <<b; cout <<"the number u entered are "<<b <<endl; return 0; }
3 RĂ©ponses
+ 2
You should have
cin >> b; // This reads from cin and writes to b
and not
cin << b; // This writes b to cin
0
thanks
0
cout << "The number you have entered is " << b << ".\n";