Feed Headline Animator

What is variable and what are its types

Variable: -

It is a space or a location where we keep some constant value. There are four types of variable in C language. (1) Integer variable (2) Float variable (3) Character variable (4) String variable

(1) Integer variable: -

A variable or a place we keep or put only integer constant is called integer variable. It is declared a deserved word ‘int’. For example a=5, then a will be integer variable.

(2) Float variable: -

A location or variable where we put some float or real data is called float variable. It is declared a deserved word ‘float’. For example a=5.55 then a will be a float variable.

(3) Character variable: -

A variable which keep only the character constant is called character variable. It is declared a deserved word ‘char’. For example a=’1’, now a will be a character variable.

(4) String variable: -

A variable which can store a string constant is called a string variable. For example a[8]= “ pakistan ” ; then a[8] will be string variable.


Posted by: Wasim Javed

No comments:

Post a Comment