I didnt understood variables | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

I didnt understood variables

20th Aug 2016, 3:29 AM
Parth
6 Answers
+ 7
A variable is like a box. You create a box with a name. int x; // Empty variable, Empty box. int y = 5; // Here we put 5 into this variable or box. Console.Write(y); // Here we open the box and use what we put inside it. So the output will be 5. // With our empty box x, we can put values inside of it. x = 10; // Here we open our box and puts 10 inside it. It's the same thing with all variable types.
20th Aug 2016, 10:29 AM
Andreas BeEm Kvist
Andreas BeEm Kvist - avatar
0
understand it like this we work on ram ..means whtevr we do it stores on ram now variable is just a named location in ram were we can store value nd later retrive them
21st Aug 2016, 11:01 AM
Rahul Srivastava
Rahul Srivastava - avatar
0
variable is the initialize of value.. for example ones = 10 you can call the 10 with name "ones"
22nd Aug 2016, 9:29 AM
Muhamad Deva Arofi
Muhamad Deva Arofi - avatar
0
int just a number value, not charachter value
14th Nov 2016, 2:38 AM
Akhmad Azza Bariklana
Akhmad Azza Bariklana - avatar
0
thanks
12th Jan 2017, 2:48 PM
Life is Game
Life is Game - avatar
- 4
Im still learning so correct me if im wrong example: int myName = "Moro" int = data type myName = name "Moro" = value the three together form a variable. Note: the value isn't necessary to form a variable, but a variable consist of "data type + it's name given by you"
20th Aug 2016, 4:11 AM
MoroAstray
MoroAstray - avatar