Lecture 2 Introduction to c
Lecture 2 Introduction to c
Programming Fundamentals
Department of Computer Science 2
What is C???
◼ C is a programming language developed at AT
& T’s Bell Laboratories of USA in 1972.
◼ It was designed and written by a man named
Dennis Ritchie.
◼ In the late seventies C began to replace the more
familiar languages of that time like PL/I, ALGOL, etc.
◼ No one pushed C.
An integer constant must have at least one digit. It must not have a decimal
point.
These rules remain same for all the types of primary and
secondary variables.
int is 4 bytes
float is 4 bytes
double is 8 bytes
• You can get the size of the data type using sizeof(data type) function
(e.g. sizeof(char))
• Compiler to compiler these size varies.
◼ Line 10
Note:
◼ C allows only one variable on left-hand side of =.
That is, z = k * l is legal, whereas k * l = z is illegal.