Explain the function and usage of variables.

Q15. Explain the function and usage of variables with example.

Ans. Variables represent named storage locations, whose values can be manipulated during program run. For instance, to store name of a student and marks of a student during a program run, we require storage locations that too named so that these can be distinguished easily. Variables, called as symbolic variables, serve the purpose. The variables are called symbolic variables because these are named locations. For instance, the following statement declares a variable i of the data type int:

int i;

Leave a Reply

Your email address will not be published. Required fields are marked *

%d bloggers like this: