Keywords,Constant & Identifiers in C
Concept of words:-
The meaningful set of character is known as words.
The words can be categories as:-
1Keywords.
2)Identifiers.
3)Constants.
Keywords :- Predefine or Reserved words.
Keywords are the predefined words that can be used for their specific purpose.
There are only 32 keywords in C
For eg:- int ,for,else,if,break,continue e.t.c.
Identifiers :- User define words.
Identifiers are the userdefined words that can be used to refer the diffrent elements of a program.
For eg:- roll no.,name,age e.t.c.
Constants:- The Constant are the fixed values that remain unchanged throughout the program.
There are following types of Constant.
1)Integer Constant.
2)Floating Constant.
3)Character Constant.
4)String Constant.
Integer Constant:- An Integer Constant is composed of 0 to 9 digit , + or - sign.
For eg :- Roll no (1700)
Pin code(221001)
6 (month no)
Floating Constant:- (Real Constant)
Floating Constant is also known as real constant.
A real constant is composed of 0 to 9 digit , + or - sign and the decimal points.
For eg :- 35.5%(percentage)
3.5 kg (quantity)
Character Constant:- A Character Constant is a singla character that is enclosed with in a single quotation mark.
For eg :- 'A','P','&','+','-' e.t.c.
String Constant:- String Constantis the set of character enclosed with in a double quotation Marks.
For eg:-"Nayanika","Ck77" e.t.c.
No comments: