+ 1

Can someone simply explain variables please?

It's really hard for me to understand how variables work for some reason, what do they actually do, how do they act?

10th Nov 2016, 11:03 PM
Teh Man
Teh Man - avatar
4 Respuestas
+ 3
Simply variables vary in value. The data type appears before the variable name. (int, float, boolen). Variables are place holders so you can refer to them by a name like x. If i say int x = 5 +5 then you know x = 10. now i can refer to the variable x and use it to print like cout << x; or define another variable y... int y = x + x; Variables help keep consepts straight by using clear names as variables. for example. int apples = 5. Just remember they are names that hold values that vary.
11th Nov 2016, 5:01 AM
B. Smith
+ 1
Variables are simply numbers without the numbers. The numbers are blanke you basically have to find out what the numbers are. And u substitute the space with a letter that is equal to the number you dont have.
12th Nov 2016, 8:04 PM
Zman0528
0
Thanks so much guys u are great
11th Nov 2016, 5:44 PM
Teh Man
Teh Man - avatar
0
variables are those whose value is not constant that means it varies throughout the program.
22nd Dec 2016, 2:38 PM
sebani