+ 1

I donā€™t know the exact mean of variable can some one explan me ?

3rd Jan 2019, 10:25 AM
Sahiba Rashidi
Sahiba Rashidi - avatar
6 Answers
+ 4
Think of them like box's say we have int x = 100; ā¬‡ "int" ā†Ŗ this box šŸ“¦ is for numbers xā†Ŗ is the šŸ· attached to the number šŸ“¦ with x written on it = means store this 100 in number box šŸ“¦ labeled šŸ· x If we open the box labeled x inside theres the value 100 so we now know box/variable x = 100 šŸ˜…
3rd Jan 2019, 11:02 AM
D_Stark
D_Stark - avatar
+ 2
very nice tanks
3rd Jan 2019, 11:08 AM
Sahiba Rashidi
Sahiba Rashidi - avatar
+ 1
To put it as simple as i can.. A variable is like a container for some kind of value, it can be an integer value like ā€œ10ā€, a float/double value like ā€œ10.23ā€, can be a single char or an entire string value like ā€œhello! iā€™am a variableā€, or a boolean value that is ā€œtrueā€ or ā€œfalseā€. When we declare a variable, the variable will request some space in the memory to store the value it is meant to.. If we declare an int variable like: int a = 3; then the variable will request the space in the memory to hold the value ā€œ3ā€. Variables after are declared, can be used and modified all the time we need in our program!
3rd Jan 2019, 10:42 AM
Sekiro
Sekiro - avatar
+ 1
thanks a lot i get it
3rd Jan 2019, 10:46 AM
Sahiba Rashidi
Sahiba Rashidi - avatar
+ 1
Variable is like a basket you can put number and characters in it First step What kind of thing you put in variable if you want to put integers then you use "int" Second step name of you variable Let take "a" as name of variable So let's creating variable program Int main() { Int a; cout << "Enter number in variable "; cin >> a; cout << a; } Explainion cin >> a Takes number you want to store in variable And cout << a Print the number you store in the variable
3rd Jan 2019, 10:46 AM
Saad Saleem
Saad Saleem - avatar