0
What are variables ? And what are their uses ?
5 Answers
+ 1
variables are temporal placeholders for storing values
+ 1
A variable is a symbolic name for (or reference to) information. The variable's name represents what information the variable contains. They are called variables because the represented information can change but the operations on the variable remain the same. In general, a program should be written with "Symbolic" notation, such that a statement is always true symbolically. For example if I want to know the average of two grades, We can write "average = (grade_1 + grade_2) / 2.0;" and the variable average will then contain the average grade regardless of the scores stored in the variables, grade_1 and grade_2.
/// quote.
+ 1
Variable is a thing which stores the data according to its corresponding data type..
Eg:- int variable stores integer values . Consider x=2 . Here x is an integer variablr which stores the value 2
0
Variables are places where you can store data, the four main types of data types are float, int, String, and char.
Char is for storing characters
Ex: a, f, u
String is for storing multiple chars
Ex: Hello
int is for storing numbers, only full numbers ( no decimals or negative numbers)
Ex: 6
double is basically an int with decimals and negative numbers
Ex: -6, 6.6
0
Thanks to all. Now i have understood the meaning of variables.