Why doesnt this code allow me to put an input? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Why doesnt this code allow me to put an input?

#include <iostream> using namespace std; int main() { int a; cout << "Enter"; cin << a; cout << a; return 0; }

5th Jun 2017, 1:09 AM
koala 🐨
koala 🐨 - avatar
2 Answers
+ 5
cin has the << the wrong way around. it should be cin >> a;
5th Jun 2017, 1:12 AM
jay
jay - avatar
5th Jun 2017, 1:14 AM
jay
jay - avatar