What is identifier in C

Interview Questions
  • What is identifier in C.
  • What is keyword in C.
  • What is the difference between constant and variable in C.

What is identifier in C

In C Programming language, the name of variables, functions, labels and user-defined entities are called Identifiers. Each element of a C program are given an identifier. A C identifier can be of any length, there is no limit on the length of the identifiers. An identifier cannot be same as any C keyword.
For Example

int totalAmount;
int getCompoundInterest(int amount, int rate, int time);
Interest is an identifier for a variable of integer data type.
getCompoundInterest is an identifier for a function and amount, rate and time are identifiers for function arguments.

What is keyword in C

C keywords are the reserved words which are pre-defined in C language. We cannot use keywords as an identifier for variable or function. Each keyword has a pre-defined meaning for C compiler. All C keywords are in lower case letters.
Some example of C keywords : break, case, continue, switch, for etc.

What is the difference between Constant and Variable in C.

Constants in C refer to fixed values that program cannot change during the time of execution whereas a variable in C is the name given to a memory location, where a program can store data. Variables can be initialized at the time of declaration and can be changes later whereas a constants cannot change.

Related Topics
What is void data type in C
What is the difference between auto variable and register variable in C
What is operator in C
What is static variable in C
What is bitwise operator in C
Write a C program to reverse a string.
What is Wild pointer in C.
What is Memory leak in C and how can we avoid it.
What happens when we try to access NULL pointer in .C
Is C programming language is case sensitive