User Input Variables | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

User Input Variables

so i went to coding playground and tried the code int main () { int a; cout <<"please enter number"/n cin>> a; return 0 } when you enter the number and go to run..... it gives me other numbers on the output.... why?

8th Aug 2017, 8:50 PM
Alyssa Ann
Alyssa Ann - avatar
2 Answers
+ 3
Your code has a few errors, we cannot help if you don't give us a copied form of the code you tried. As of right now you have missing semicolons and don't output anything.
8th Aug 2017, 11:59 PM
Jordan Chapman
Jordan Chapman - avatar
0
It should be cout<<"please enter number\n"; You have missed ; And written \n outside the cotation
9th Aug 2017, 4:44 AM
Irwin Lopez
Irwin Lopez - avatar