introduction to c language helps to know about the c langugaeg
sdsharmila11
6 views
6 slides
Feb 26, 2025
Slide 1 of 6
1
2
3
4
5
6
About This Presentation
introduction to c
Size: 36.91 KB
Language: en
Added: Feb 26, 2025
Slides: 6 pages
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; }