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??
2 Réponses
+ 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
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...