+ 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
5 RĂ©ponses
+ 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