15
INTRODUCT ION OF C LANGUAGE By Kirti sachan

Introduction to c programming

Embed Size (px)

Citation preview

Page 1: Introduction to c programming

INTRODUCTION OF C LANGUAGE By

Kirti sachan

Page 2: Introduction to c programming

ALL ABOUT C LANGUAGE :

C is developed by Dennis Richie

C is structured programming language

Comments in c provide easy readability

C is powerful language

C is high level language with low level features

Page 3: Introduction to c programming

RUNNING A C PROGRAM Type a program Save it Compile it –it will be converted into exe

(executable) Run the program (the compiler checks for errors ,if any before

execution )

Page 4: Introduction to c programming

WHAT ARE C TOKENS AND TYPE OF C TOKENS IN C LANGUAGE

The smallest individual units in c program . They are source –program text which the compiler doesn’t furthur breakdowns.

Page 5: Introduction to c programming

There are 6 different types of token in c

Keywords (float,int,while etc) Identifiers(main ,amount etc) Constants ( 17.5 , -23.4 etc) Strings ( “hello” , “lets go” ) Special symbols ( {},[],& ) Operators ( +,-,*,/ )

Page 6: Introduction to c programming

KEYWORDS They have special

meaning to compiler They are written

only in lower case They are of great

importance in writing a c program

There are only 32 keywords available in c

Page 7: Introduction to c programming

CONSTANTS Constants are fixed

values which do not change during program execution

Page 8: Introduction to c programming

MORE ABOUT CONSTANTS

Integer constants refers to series of digit such as decimal integer ,octal integer ,

hexadecimal integer Eg : 121 ,ox2 etc Real constants The floating point constants such as -0.05 , 9.34 Single character constants It consists of single character enclosed within pair of single quotes (‘ ‘).

Eg : ‘ &’ , ‘a’ etc String constants A string constant It is a sequence of characters enclosed within double quotes (“ “ ) Eg: “ hello”

Page 9: Introduction to c programming

VARIABLES It is a data name used to store any value Are used to store values which can be changed

during program execution Variable names in c May only consist of letters , digits and

underscores First 31 characters are significant May not begin with a number May not be a keyword Should start with letter or underscore(_) No other special characters are allowed except

space

Page 10: Introduction to c programming

DATA TYPES

Page 11: Introduction to c programming

1. INTEGER It is a number without a fraction part Represents a signed integer of4 or 8 bytes

or32 0r 64 bit Designed to hold whole numbers Can be signed or unsigned Eg: 12 -5 7o Available in different sizeso Int , short Int and long int o Size : short int < int < long int

Page 12: Introduction to c programming

CHARACTER Represents a single byte of storage i.e 8 bits

of storage Used to hold characters like “d” or “a” etc Numerical value is associated with character

via a character set Numeric value of a character in memory Code: memory: Char : “place” place 67

Page 13: Introduction to c programming

3. FLOATING POINT It is a type of number a fractional part Designed to hold real numbers Eg 12.5 -3.4 All numbers are signed Available in different sizes float<double <

long double

Page 14: Introduction to c programming

4. VOID It has no values and no operations

Page 15: Introduction to c programming

THANK YOU Hope it was helpful