A variable can be defined as a quantity, which may vary during program execution.
The name given to the memory location which stores the quantity is called variable name. There are certain rules, which must be followed while naming a variable. A variable name can be any combination of alphabets, digits or underscores. The length of variable name can range from 1 to 8. The first character of the variable name must be an alphabet. No commas or blanks are allowed within a variable name and no special symbol other than underscore can be used. ‘C’ is a case sensitive language i. e. variable name ‘NAME’ and ‘name’ are different variables.
Declaration is the place where the nature of the variable (i. e. type of variable) is stated but no storage is allocated. Definition refers to place where the variable is created or stored.
Any variable must be declared before we use it. The variable is declared as followsStorage – class data – type variable – name;
Let us keep the storage-class part aside right now. We will consider it later.Data – type variable – name;
Meaningful names must be given to variables. Two or more variables of the same type can declare separating them with comma.
E. g.int m, m_hra;
Thus declaration specifies a type and contains a list of one or more variables of that type.
C Related Interview Questions
|DBMS Interview Questions||C++ Interview Questions|
|C & Data Structures Interview Questions||Java Interview Questions|
|Go (programming language) Interview Questions||F Sharp (programming language) Interview Questions|
|C preprocessor Interview Questions||R Programming language Interview Questions|
|D Programming Language Interview Questions||Lua (programming language) Interview Questions|
|Embedded C Interview Questions|
Introduction To C-programming
Data Types And Storage Classes
All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd
Wisdomjobs.com is one of the best job search sites in India.