1 Answers
A typical variable declaration is of the form:
// Declaring a single variable type variable_name; // Declaring multiple variables: type variable1_name, variable2_name, variable3_name;
A variable name can consist of alphabets (both upper and lower case), numbers and the underscore ‘_’ character. However, the name must not start with a number.
// Create a string variable
string greeting = "Hello";
// Declaring float variable float simpleInterest; // Declaring integer variable int time, speed; // Declaring character variable char var;