0

What are variables? Why are they important in a program?

variable

31st Aug 2018, 3:50 PM
Abhinaya
Abhinaya - avatar
5 Answers
+ 3
You can say in simple way that variable is just a box in which you can pack something in box what you want. variable is the most common used term in programming.hundred of lines code contain hundred of variable. e.g x=10 now think x is just a box in this box you are storing some value which is 10 this box means this variable help you to create more variable with the help of this valuable. y=x+1 here you create another box.this box is greater than x box in this box you are storing x box and 1 or you can say x variable and 1. Every box has memory size and memory address.Which help the interpret or compiler to find the box or you can say variable.
31st Aug 2018, 4:32 PM
Maninder $ingh
Maninder $ingh - avatar
+ 2
Just think of them as containers to store data so that it can be used later. Otherwise, the data would be gone just as quickly as it was used. To put it into an analogy, think of it like a cup. The cup is a container that can hold onto the substance you're working with. If you put the substance in the cup, you can carry it around and use it later whenever you need it, as well as manipulate the contents when you need to. If you didn't have a cup to hold the substance (data), then you'd use it in that immediate moment before it all slips out of your hands and disappears. Not ideal for being able to use the data later.
31st Aug 2018, 3:58 PM
Fata1 Err0r
Fata1 Err0r - avatar
+ 1
thanks
1st Sep 2018, 1:30 AM
Abhinaya
Abhinaya - avatar
0
can u teach me...
31st Aug 2018, 6:19 PM
Rameshwar Shivshette
Rameshwar Shivshette - avatar