introduction to c language helps to know about the c langugaeg

sdsharmila11 6 views 6 slides Feb 26, 2025
Slide 1
Slide 1 of 6
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6

About This Presentation

introduction to c


Slide Content

C LANGUAGE

Introduction Derived from B basic C  is a procedural programming language initially developed by  Dennis Ritchie  in the year  1972  at Bell Laboratories of AT&T Labs . It was mainly developed as a system programming language to write the  UNIX operating system . General Purpose and Portable Low-level Memory Access Clean Syntax

Structure of a c language Documentation section/comment section //single line// /* milti -line*/ Header file section/ linking section Definition section Global declaration section Main section { Declaration part Execution part }

Syntax #include< stdio.h > preprocessot directive(Header file) Main() main function { Statement1; Statement2; program statement return 0; g etch () }

Data types There are three types of data types in c Int ( used to store any number including positive, negative and zero without decimal part) Declaration: int %d Float( used to store numbers with decimal point ) Declarion:float %f Char( used to declare character data type ) Declarion:char %c Variables are declared before they are used in program.

Example //program to add the given two numbers// #include< stdio.h > Main() { Int a,b,c ; Printf (“enter a b values”); Scanf (“% d%d ”,& a,&b ); C= a+b ; Printf (“ the result is % d”,c ); r eturn 0; }
Tags