What types of variable declaration is used in program.

Q15. What type of variable declaration the following program is using?

              :

              :

int main()

{

       int area, length=10,width=12,perimeter;

       area=length*width;

       perimeter=2*(length+width);

       :

       :

}

Ans. The above program is using two types of variable declarations:

  1. Simple definition or uninitialized variables for variables area and perimeter.
  2. Initialized variables fro variable length and width.

Leave a Reply

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

87 Views
%d bloggers like this: