why didn't we write cin>>10 as he said in the question "the prog. prompts the user to input a num." Instead of cin>>a.Any help?? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

why didn't we write cin>>10 as he said in the question "the prog. prompts the user to input a num." Instead of cin>>a.Any help??

12th Dec 2016, 8:32 PM
NadaKarim
2 Answers
+ 3
because 10 is a constant number you want to let the user the ability to input any number INTO a variable, in this case, a variable named a
12th Dec 2016, 8:39 PM
Burey
Burey - avatar
0
we cannot use digits alone as a variable.. like : int 10; //It's a wrong way of declaration Similarly.. cin is used to fetch user end input.. and these inputs will be stored In a variable.. and variables are combinations of letters and digits.. which act as a memory storage...
12th Dec 2016, 8:38 PM
Мг. Кнап🌠
Мг. Кнап🌠 - avatar