1. KEYWORDS IN C
LANGUAGE
NAME: JOYDEEP PAL
STUDENT CODE: BWU/BBT/18/036
SUBJECT: COMPUTER APPLICATION
REG: NO: 18013000519 of 2018-2019
ROLL NO: 18010310021
2. WHAT IS KEYWORD IN C
PROGRAMMING ?
• Keywords are defined, reserved word used in C programming language that have
a special meaning.
• These reserved words not be used as constants or variables or any other identifier
names.
For example: int weather;
Here, int is a keyword that indicates “weather” is a variable of type integer.
3. TYPES OF DATA
• C language supports 2 different type of data:
1. Primary data types: These are fundamental data types in C namely integer (int),
floating point (float), character (char).
2. Secondary/derived data types: Derived data types are nothing but primary data
types but a little twisted or grouped together like array, structure, union and pointer.
4. FORMAT SPECIFIERS
• Format specifiers are needed to access different data types :
• “Int” (%d): Integers is used for storing integers values (like: -1,0,1 etc.)
• “Float”(%f): Float is used for storing decimal numbers (like: 1.5,5.1,-2.1 etc.)
• “Char” (%c): Character is used to store single letter or special symbol (like: a,
B,$, #).
5. # include <stdio.h>
void main ()
{
int x=1;
here, int, float, char
are the keywords.
float f= 5.5;
char c=$;
printf (“%d n”, x);
printf (“%f n”, f);
printf (“%c n”, c);
}
6. STORAGE CLASSES
• In addition to data type, storage class provides information about variables like:
1. Automatic (auto): Default storage class. It is a local variable with garbage value.
Example: int x; is same as auto int x;
2. Register: here local variables are stored in register and has garbage value.
example: register int x;
3. Static: It is also local variable but with 0 default value. Example: static int x;
4. External (extern): This is defines global variable with 0 default value. Example:
extern int x;
7.
8. LOOPS IN C
• How it is works? “While” loop
‘while’ loop can be addressed as an entry
control loop. It is p completed in 3 steps:
Variable initialization (e.g. int x =0; )
condition (e.g. while (x<=10) ), Variable
increment or
decrement (e.g. x++ or x -- or x=x+2).
• After every execution of the loop body, condition is verified, and if it is found to be true the loop body is
executed again. When the condition check returns false, the loop body is not executed, and execution breaks out
9. SYNTAX OF WHILE LOOP
#include <stdio.h>
void main ()
{
int x;
x=1;
while (x<=10);
{
printf (“%d n”, x);
x++; x= x+1, increment x by 1
}
}
10. SUMMARY
• C is a structured programming language developed by Dennis Ritchie in 1973
at Bell Laboratories. It is one of the most popular computer languages today
because of its structure, high-level abstraction, machine independent feature
etc.
• Keywords are preserved words that have special meaning in C language. The
meaning of C language keywords has already been described to the C compiler.
These meaning cannot be changed. Thus, keywords cannot be used as variable
names because that would try to change the existing meaning of the keyword,
which is not allowed There are total 32 keywords in C language. Examples: If, else,
for, void etc..
11. I would like to thank respected faculties, RITESH SIR, SITIKANTHA SIR AND
OUR HOD Dr. PIJUSH MALLICK SIR for gave me this opportunity.
THANK YOU