Wednesday, February 27, 2013

Ques-10: What is variable? Where is it used?

The definition of variable and where it is used is given below.

Solution:

Variable: A variable is a named location in a memory that is used to hold a value that can be modified by the program.All variable must be declared before they can be used.

General form of variable declaration is -

                                                                      type_variable list;

Here type must be a valid C data type  and variable list may consist of one or more identifier names separated by comma (,).

         int i;
         double balance,profit,loss;


 Where it is used:

There are three basic places where variables are used.

1. Inside the funtion
2. In the definition of the function.
3. Outside of the function.

No comments:

Post a Comment