How to declare variable | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

How to declare variable

24th Nov 2018, 10:51 AM
Zohaib Rehman
Zohaib Rehman - avatar
3 Answers
+ 1
Hello! Unfortunately, questions like yours do not really belong here, because the answers are in SoloLearn's courses. Please try learning a bit before you ask a question :). I recommend you to read the guidelines of the Q&A Section down below. https://www.sololearn.com/Discuss/1316935/welcome-to-sololearn-forum/
24th Nov 2018, 11:50 AM
inxanedev!
inxanedev! - avatar
0
I don't know
24th Nov 2018, 10:51 AM
Zohaib Rehman
Zohaib Rehman - avatar
0
In C++ First specify the data type then give your variable a name. At last put a ; semicolon Name of the variable can only begin with a alphabet not with numbers and special characters like &-+( etc. You cannot make use of spaces in a variable. Example int num; You can also initialize your variable at the time of declaration . int num = 123;
24th Nov 2018, 10:59 AM
Vivek
Vivek - avatar