Professional Documents
Culture Documents
Overview of C Language Overview of C Language: History History
Overview of C Language Overview of C Language: History History
Overview of C Language Overview of C Language: History History
History
Overview of C language C is a structured programming language developed
by Dennis Ritchie in 1973 at Bell Laboratories.
C programming language features were derived from
an earlier language called “B”.
C language was invented for implementing UNIX
operating system.
Today's most popular Linux OS and RBDMS MySQL
have been written in C.
Features
Simple
Portable
Structured programming language
Rich library
Memory Management
Speed
Pointer
Recursion
Middle level language
/* Welcome /* friends */ ! */
Illegal
1
2/15/2023
2
2/15/2023
Example 1(Cont.)
scanf("%f",&r);
Basic Syntax
area=PI*r*r;
printf("Area of the circle=%f",area);
getch();
}
Tokens Semicolons(;)
A token is either a keyword, an identifier, a It is a statement terminator.
constant, a string literal, or a symbol. Each individual statement must be ended with a
Eg. printf("Hello, World! \n"); semicolon.
The individual tokens are: It indicates the end of one logical entity.
printf Eg.
( printf("Hello, World! \n");
"Hello, World! \n" return 0;
) or
; printf("Hello, World! \n"); return 0;
Comments Identifiers
Comments are like helping text in your C program A C identifier is a name used to identify a
and they are ignored by the compiler. variable, function, or any other user-defined
Single line comment: //first program in c item.
Multiline comment: /* first An identifier starts with a letter A to Z or a to
z or an underscore _ followed by zero or more
program
letters, underscores, and digits (0 to 9).
in
C does not allow punctuation characters such as
C */ @, $, and % within identifiers.
C is a case sensitive programming language.
Eg. int money;
Here, money is identifier.
3
2/15/2023
Identifiers(Cont.) Keywords
Acceptable identifiers: They are reserved words in C.
mohan zara abc These reserved words may not be used as constant
move_name a_123 myname50 or variable or any other identifier names.
_temp j a23b9 Eg. int money;
retVal Here, int is keyword.
Whitespace
Whitespace describes blanks, tabs(\t),
newline(\n) characters.
Whitespace separates one part of a statement from
another and enables the compiler to identify
where one element in a statement, such as int,
ends and the next element begins.
Eg. int age;
Q & A
abc@12
xyz!
Smith
S09
A_b
$abc
12ab
float
break