Download as pdf or txt
Download as pdf or txt
You are on page 1of 18

I.

 C. V. POLYTECHNIC
JHARGRAM
DEPARTMENT OF COMPUTER SCIENCE & TECHNOLOGY
2ND YEAR – 3RD SEMESTER

E‐CONTENTS : PROGRAMMING IN C
BASICS OF C
UNIT : 1

Developed By :
Biswajit Roy, Lecturer
Computer Applications (Post Diploma)
I. C. V. Polytechnic, Jhargram
1.1 History of C, Advantages of Structured
Program, Files (source, header, object, binary
executable) used in C, Characteristics of C.
1.2 C character set, Tokens, Constants, Variables,
Keywords, Data types used in C.
1.3 C operators (arithmetic, logical, assignment,
relational, unary, binary, increment and
decrement, conditional, bit wise, special,
comma, sizeof, postfix, prefix etc.), Operator
precedence, Associativity of operators, Type
conversion, Typecasting.
1.4 Formatted input, Formatted output.
27‐08‐2020 I. C. V. Polytechnic – Programming in C 2
C programming language was developed in
1972 by Dennis Ritchie at Bell Laboratories of
AT&T (American Telephone & Telegraph), U.S.A.

It was developed to overcome the problems of


previous languages such as BCPL, B etc. It
inherits many features of previous languages.

Initially, C language was developed to improve


an OS called Multics, finally the world got the
game changer, UNIX operating system.
27‐08‐2020 I. C. V. Polytechnic – Programming in C 3
27‐08‐2020 I. C. V. Polytechnic – Programming in C 4
27‐08‐2020 I. C. V. Polytechnic – Programming in C 5
27‐08‐2020 I. C. V. Polytechnic – Programming in C 6
27‐08‐2020 I. C. V. Polytechnic – Programming in C 7
27‐08‐2020 I. C. V. Polytechnic – Programming in C 8
27‐08‐2020 I. C. V. Polytechnic – Programming in C 9
27‐08‐2020 I. C. V. Polytechnic – Programming in C 10
27‐08‐2020 I. C. V. Polytechnic – Programming in C 11
27‐08‐2020 I. C. V. Polytechnic – Programming in C 12
Arithmatic
Assignment Relational Logical Bitwise Special Conditional
Unary Binary

‐ + += > ! ~ , ?:
++a
a++
‐ ‐= < && << *
‐‐a
a‐‐
* *= >= || >> &
sizeof / /= <= & .
% %= == | ‐>
!= ^
27‐08‐2020 I. C. V. Polytechnic – Programming in C 13
27‐08‐2020 I. C. V. Polytechnic – Programming in C 14
Operators Precedence and Associativity are two
characteristics of operators that determine the
evaluation order of sub‐expressions in absence of
brackets
27‐08‐2020 I. C. V. Polytechnic – Programming in C 15
double
float
int
Char

27‐08‐2020 I. C. V. Polytechnic – Programming in C 16


 Format specifier
%c char 1 Byte
%d int 2 Byte
%f float 4 Byte
%s string 1 Byte / Character
%wd int with width
%w.nf float with width and decimal part
%ws string with width
normally right justified with tab setting

I/P scanf(“<fotmat specifier list>”, &variable list)


O/P printf(“<fotmat specifier list>”, variable list)
27‐08‐2020 I. C. V. Polytechnic – Programming in C 17
27‐08‐2020 I. C. V. Polytechnic – Programming in C 18

You might also like