C is used for creating computer application.
Used in writing embedded software.
Create compiler for different language.
Implement different operating system.
2. History of c.
Introduction to c.
Uses of c & importance of c.
C tokens.
Array, string, pointers.
Structures and unions.
3. year language Developed by
1960 ALGOL INTERNATIONL GROUP
1967 BCPL MARTIN RICHARDS
1970 B KEN THOMPSON
1972 C DENNIS RITCHIE
1978 K&RC KEMIGHAN &RITCHIE
1989 ANSI C ANSI COMMITTEE
1990 ANSI/ISO ISO COMMITTEE
1999 C99 STANDARDIZATION
COMMITTEE
4. C is a structured programming language.
C was originally developed in the 1972 by dennis
ritchie at bell telephone laboratories.
C is a high level language, which is developed for
UNIX operating system.
C is often called a middle level language because
it combines the best element of low level
language or machine level language with high
level language.
5. C is used for creating computer application.
Used in writing embedded software.
Create compiler for different language.
Implement different operating system.
6. Very simple language.
Highly portable.
Middle level language.
Only 32 keywords so easy to make.
Very fast execution speed.
7. Individual words and punctuation marks are called
tokens.
The smallest individual units are known as tokens
C tokens
Keywords constants strings operators
Special symbolsidentifiers
float
while
100
14.5
“IJK”
“Best”
main
amount
+ -
* /
{ }
[ ]
8. Every C word is classified as either a keyword or
an identifier.
All keywords have fixed meaning and these
meaning cannot be changed.
All keywords must be written in lowercase .
• auto
• break
• case
• char
• const
• continue
• default
• do
• double
• else
• enum
• extern
• float
• for
• goto
• if
• int
• long
• register
• return
• short
• signed
• size of
• static
• struct
• switch
• typedef
• union
• unsigned
• void
• volatile
• while
9. First character must be an alphabet (or
underscore).
Must consist of only letters , digits and
underscore.
Only first 31 characters are significant.
Cannot use a keyword.
Must not contain white space.
10. C refers to fixed values that do not change
during the execution of a program
constants
Numeric character
singlerealint string
decimal
octal
Hexa
decimal
exponentfractional
11. Constant meaning
‘ a’ Alert
‘ b’ Backspace
‘ f Form feed
‘ n’ New line
‘ r’ Carriage return
‘ t’ Horizontal tab
‘ v’ Vertical tab
‘” Single quote
`”' Double quote
‘?’ Question mark
‘’ backslash
12. A variable is a data name that may be used to
store a data value.
A variable name can be chosen by the
programmer in a meaningful way.
14 5 19
a b c
13. They must begin with a letter.
Uppercase and lowercase are significant.
It should not be a keyword.
White space is not allowed.
Variable name valid Remark
First -tag valid
char Not valid Char is a
keyword
Price$ Not valid Dollar sign is
illegal
Group one Not valid Blank space is
not permitted
Int_type valid Keyword may be
part of a name
14. C language is rich in data types .
A data type define as set of values and the
operation that can be performed on them.
Primary data types
Derived data types
User defined data types
D
A
T
A
T
Y
P
E
S
15. Data types represent types of input to be carried
in variable.
9 3.5 ‘d’
Integer(number)
Float
(number) character
16. primary Data type
character integer float void
char signed unsigned float
signed int int double
un signed short int short int long
double long int long int
17. type Size(bits) range
Char or unsigned
char
8 -128to 127
Unsigned char 8 0 to 255
Int or signed int 16 -32,768 to 32,767
Unsigned int 16 0 to 65535
Short int or signed
short int
8 -128 to 127
Unsigned short int 8 O to 255
Long int or signed
long int
32 -2,147,483,648 to
2,147,483,647
Unsigned long int 32 0 to 4,294,967,295
Float 32 3.4E-38 to
3.4E+38
Double 64 1.7E-308 to
1.7E+308
18. Stdio.h Standard i/o header file
Conio.h Console i/o header file
String.h Collection of character make string
Math.h Used to mathematic function
Graphic.h Used to draw any shape
Dos.h Delay output
19. get char():
get char() function is used to get
/read a character from keyboard.
getchar(char);
Put char();
put char () to output the values of
character variable.
putchar(char);
20. Printf() function is used to print the “character
string ,float , integer , octal and hexadecimal
values” on to the output screen.
Printf() function with %d format specifier to
display the value of integer variable.
Scanf() function is used to read character,
string, numeric data from a keyboard.
21. An array is a fixed size sequenced collection of
elements of the same data type.
An array is a group of related data items that
shared a common name.
ARRAYS
ONE
DIMENSIONAL
ARRAYS
TWO
DIMENSIONAL
ARRAYS
MULTIDIMENSION
AL ARRAYS
22. A pointer is derived data type in c
Pointers contain memory addresses as their
values.
Pointers are more efficient in handling arrays
and data tables.
Pointers can be used to return multiple values
from a function via function arguments.
Pointers allow c to support dynamic memory
management.
Pointers reduce length and complexity of
programs.
They increase the execution speed and thus
reduce the program execution time.
23. A String is a sequence of character that is
treated as a single data items.
Any group of characters(except double quote
sign)define between double quotation marks
is a string constant.
Character strings are often used to build
meaningful and readable function.
char string-name[size]
24. C library supports a large number of string
handling function .
Function action
Strcat() Concatenates two string
Strcmp() Compare two strings
Strcpy() Copies one string over
another
Strlen() Finds the length of a string
25. A structure in C is a collection of items of different
types.
A structure creates a data type that can be used to
group items of possibility different types into a single
type.
‘struct’ keyword is used to create a structure.
struct address
{
Char name[50];
Char street[100];
Char city[50];
Int pin;
}
26. A union is a special data type .
C allows to store different data types in the
same memory location.
Define a union with many members ,but only
one member can contain a value at any given
time.
Union provide an efficient way of using the
same memory location for multiple –purpose.