Home > Programming In C > C-Variable Types

C-Variable Types

C-Variable Types – It Is Name Given To A Memory Location That May Be Used To Store Data Values. The Variable Name Is Chosen By Programmer In A Meaningful Way.

  • The Variable Names Should Not Be The Standard Keywords That Are Present In The Library Functions.

Examples For Variable – Sum, avg, total Etc

Rules That You Should Follow While Declaring The Variable – 

  • The Variable Should Began With Letter.
  • The Length Of The Variable Must Not Exceed 31 Characters In ANSI Standard.
  • Upper & Lower Characters Are Different. eg:- total,TOTAL,Total.
  • Variable Should Not Be Keyword(int, void,char)
  • Space Is Not Allowed In Between The Letters Of The Variable.

How You’ll Declare Variable In The Program –

Syntax – datatype v1

Variable Declaration Can Be Done In Two Types :- Local Declaration, Global Declaration.

Local Variable Declaration:- If You Declare Variable Inside The Main Block Is Available With In That Block.

Global Variable Declaration:- Declaring Variable Outside The Main Block & Is Available Through Out The Program.



int a,b; /*global variable*/



int c; /* Local Variable Declaration*/




Leave a Reply

Secured By miniOrange