SlideShare a Scribd company logo
1 of 164
INTRODUCTION TO C
INTRODUCTION TO C ,[object Object],[object Object]
Features of C ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Steps in learning C Character Set Programs Instructions Tokens
C Character Set C Character Set Execution Character Set Source Character Set Special Characters Digits Alphabets Escape Sequence White Spaces
C Character Set (Cont) ,[object Object],[object Object],[object Object],[object Object]
Source Character Set Letters a to z ,A to Z Digits  0 to 9 Special Characters ! @ # $ % ^ & * ( ) _ - + = | { } [ ] etc,. White Spaces Blank Space ,Horizontal tab, New line, Vertical tab etc,.
Special characters ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Executable Character Set Characters Escape Sequence Back Space  Horizontal  Space  Vertical Space  Newline
C Tokens ,[object Object],[object Object]
C Tokens (Cont) C Tokens Identifiers Eg:main, avg Keywords Eg: int, for operators Eg: + - Strings Eg: “ab” spI symbol Eg: # $ % Constants Eg:17, 15.5
Executing a C Program Creating the Program Compilation Linking Execution
Executing a C Program (Cont) ,[object Object],[object Object],[object Object],[object Object],[object Object]
Executing C program using UNIX ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Structure of C program DOCUMENTATION SECTION PREPROCESSOR SECTION DEFINITION SECTION GLOBAL DECLARATION SECTION main() { Declaration part; Executable Part; } sub program section { Body of the subprogram; }
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
C Programs ,[object Object],[object Object],[object Object],[object Object]
Preprocessor Directives ,[object Object],[object Object]
Comments (Program documentation) ,[object Object],[object Object]
Comments (Cont) ,[object Object],[object Object],[object Object]
C program ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
C Tokens ,[object Object],[object Object],[object Object],[object Object],[object Object]
Identifiers ,[object Object],[object Object],[object Object],[object Object]
Rules for naming identifier ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Examples of Valid and Invalid Names
Variables ,[object Object],[object Object],[object Object]
Keywords ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Keywords ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Constants ,[object Object],[object Object],[object Object]
Types ,[object Object],[object Object]
Constants Constants Character Constants Numeric Constants Real Constant Integer Constant String  Constant Single Character Constant
Numeric constants ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Rules for defining Integer Constant ,[object Object],[object Object],[object Object],[object Object]
Numeric constants ,[object Object],[object Object],[object Object],[object Object]
Character constants ,[object Object],[object Object],[object Object]
Character constants ,[object Object],[object Object],[object Object]
Operators ,[object Object],[object Object],[object Object],[object Object]
Data Types ,[object Object]
Standard   Data Types These Standard type can be used to build more complex data types called  Derived Types  (e.g. pointers, array, union etc.).
Data types Data type  Size(bytes)  Range  Format string Char  1  -128 to 127  %c int  2  -32,768 to 32,767  %d Float  4  3.4 e-38 to 3.4 e+38  %f  Double  8  1.7 e-308 to 1.7 e+308  %lf
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Floating Point ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
character  ,[object Object],Character   ASCII code value a   97(decimal) or 01100001(binary) x   120(decimal) or 01111000(binary)
void ,[object Object],[object Object]
Variable ’ s Declaration ,[object Object],[object Object],[object Object],[object Object]
Entire Data types in c: Data type  Size(bytes)  Range  Format string Char  1  128 to 127  %c Unsigned char  1  0 to 255  %c Short or int  2  -32,768 to 32,767  %i or %d Unsigned int  2  0 to 65535  %u Long  4  -2147483648 to 2147483647  %ld Unsigned long  4  0 to 4294967295  %lu Float  4  3.4 e-38 to 3.4 e+38  %f or %g Double  8  1.7 e-308 to 1.7 e+308  %lf Long Double  10  3.4 e-4932 to 1.1 e+4932  %lf
Types of Operator ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Arithmetic operator ,[object Object],[object Object]
Sample program ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Division operator on Different  Data Type Operation Result Example int/int int 5/2  =  2 int/real real 5/2.0 =  2.5 real/int real 5.0/2 =  2.5 real/real real 5.0/2.0 =  2.5
Sample program ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Output ,[object Object],[object Object]
Relational operator ,[object Object],[object Object],[object Object]
Logical operator ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Sample program ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Output ,[object Object],[object Object]
Assignment operator ,[object Object],[object Object],[object Object],[object Object]
Assignment operator(Cont) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Sample program ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Output ,[object Object]
Increment or decrement operator(Unary) ,[object Object],[object Object],[object Object],[object Object],[object Object]
Sample Program ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Output ,[object Object],[object Object],[object Object],[object Object]
Bitwise operator ,[object Object],[object Object],[object Object],[object Object],[object Object]
Sample program ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Output ,[object Object]
Conditional Operator (or) Ternary Operator ,[object Object],[object Object]
Sample Program ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Output ,[object Object]
Special Operator ,[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Output ,[object Object]
Expression ,[object Object],[object Object],Expression C Expression a + b + c a + b + c a 2 +b 2 a*a + b*b
Operator Precedence & Associativity ,[object Object],[object Object],[object Object],[object Object]
Precedence Operator High * , / , % Low + , -
Example ,[object Object],[object Object],[object Object],[object Object],[object Object]
Example ,[object Object],[object Object],[object Object],[object Object]
Type Conversion ,[object Object],[object Object]
Sample Program ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Input/Output Function Input/Output  Function Unformatted Formatted Output printf() fprintf() Input scanf() fscanf() Input getc() gets() getchar() Output putc() puts() putchar()
Formatted Input/Output ,[object Object],[object Object],[object Object]
Formatted   Input and Output
Standard Output ,[object Object],[object Object],[object Object]
Format of printf Statement
Formatted Input ( scanf ) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Format of scanf Statement
Character Test Function ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
 
Decision Making ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Decision Making (cont) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
SELECTION STRUCTURE ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
IF Statement ,[object Object],[object Object],[object Object],[object Object],[object Object],If  condition False True Statements
Example ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Output ,[object Object],[object Object]
IF…ELSE Statement ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],If  Condition  True False True statements False statements
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
NESTED  IF… ELSE If Condition  1 False  Statements True If  Condition  2 True False True statements False statements
NESTED  IF… ELSE ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
IF…ELSE  LADDER Condition 1  Statements Condition 2  Statements Condition 3 Statements Statements TRUE TRUE TRUE FALSE FALSE FALSE
IF…ELSE  LADDER ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Example ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Output ,[object Object],[object Object],[object Object],[object Object],[object Object]
Looping structure ,[object Object],[object Object],[object Object],[object Object]
WHILE Loop  ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Body of The loop condition False True
Example ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Output ,[object Object],[object Object]
DO…WHILE Loop  ,[object Object],[object Object],[object Object],[object Object],[object Object],Body of The loop condition False True
for loop  ,[object Object],[object Object],[object Object],[object Object],[object Object]
for loop  Initialization condition False Body of the loop Inc / Decrement
Example ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Output ,[object Object],[object Object]
Nested for loop  ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
CASE structure Case 1 Case 2 Default case Switch
CASE structure ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Example ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Output ,[object Object],[object Object]
break Statement ,[object Object],[object Object]
Loops with break Statement ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Continue Statement ,[object Object]
Loops with continue Statement ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
goto Statement ,[object Object]
Syntax for goto Statement ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
 
getchar() Example ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
getche() Example ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Getch() Example ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
getc Example ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
gets() Example ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Example ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Output ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Finding Armstrong No ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Output ,[object Object],[object Object]
Sum of the Digits ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object]
Output ,[object Object],[object Object]
Reverse of a number ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Output ,[object Object],[object Object]
Fibonacci Series ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Output ,[object Object],[object Object]
Swapping  ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Swapping without using third variable ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Quadratic Equation ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Output ,[object Object],[object Object],[object Object],[object Object]

More Related Content

What's hot

What's hot (20)

C fundamental
C fundamentalC fundamental
C fundamental
 
Programming in c
Programming in cProgramming in c
Programming in c
 
Unit 4 Foc
Unit 4 FocUnit 4 Foc
Unit 4 Foc
 
C language unit-1
C language unit-1C language unit-1
C language unit-1
 
Programming in C Presentation upto FILE
Programming in C Presentation upto FILEProgramming in C Presentation upto FILE
Programming in C Presentation upto FILE
 
C notes
C notesC notes
C notes
 
Introduction to c++ ppt
Introduction to c++ pptIntroduction to c++ ppt
Introduction to c++ ppt
 
C-Programming C LIBRARIES AND USER DEFINED LIBRARIES.pptx
C-Programming  C LIBRARIES AND USER DEFINED LIBRARIES.pptxC-Programming  C LIBRARIES AND USER DEFINED LIBRARIES.pptx
C-Programming C LIBRARIES AND USER DEFINED LIBRARIES.pptx
 
Unit 3. Input and Output
Unit 3. Input and OutputUnit 3. Input and Output
Unit 3. Input and Output
 
C decision making and looping.
C decision making and looping.C decision making and looping.
C decision making and looping.
 
Structure in c language
Structure in c languageStructure in c language
Structure in c language
 
C presentation book
C presentation bookC presentation book
C presentation book
 
C introduction by thooyavan
C introduction by  thooyavanC introduction by  thooyavan
C introduction by thooyavan
 
Data Type in C Programming
Data Type in C ProgrammingData Type in C Programming
Data Type in C Programming
 
Functions in c language
Functions in c language Functions in c language
Functions in c language
 
Book ppt
Book pptBook ppt
Book ppt
 
Programming in c notes
Programming in c notesProgramming in c notes
Programming in c notes
 
History of c++
History of c++ History of c++
History of c++
 
C functions
C functionsC functions
C functions
 
Introduction Of C++
Introduction Of C++Introduction Of C++
Introduction Of C++
 

Viewers also liked

Introduction to the c programming language (amazing and easy book for beginners)
Introduction to the c programming language (amazing and easy book for beginners)Introduction to the c programming language (amazing and easy book for beginners)
Introduction to the c programming language (amazing and easy book for beginners)
mujeeb memon
 

Viewers also liked (20)

INTRODUCTION TO C PROGRAMMING
INTRODUCTION TO C PROGRAMMINGINTRODUCTION TO C PROGRAMMING
INTRODUCTION TO C PROGRAMMING
 
Introduction to C Programming
Introduction to C ProgrammingIntroduction to C Programming
Introduction to C Programming
 
Basics of C programming
Basics of C programmingBasics of C programming
Basics of C programming
 
C Programming Language Tutorial for beginners - JavaTpoint
C Programming Language Tutorial for beginners - JavaTpointC Programming Language Tutorial for beginners - JavaTpoint
C Programming Language Tutorial for beginners - JavaTpoint
 
C language ppt
C language pptC language ppt
C language ppt
 
Introduction to the c programming language (amazing and easy book for beginners)
Introduction to the c programming language (amazing and easy book for beginners)Introduction to the c programming language (amazing and easy book for beginners)
Introduction to the c programming language (amazing and easy book for beginners)
 
C notes.pdf
C notes.pdfC notes.pdf
C notes.pdf
 
C ppt
C pptC ppt
C ppt
 
C programming tutorial
C programming tutorialC programming tutorial
C programming tutorial
 
C Programming Example
C Programming Example C Programming Example
C Programming Example
 
Pengaturcaraan C
Pengaturcaraan CPengaturcaraan C
Pengaturcaraan C
 
Cara kerja input/proses/output, flowchart, pseudo
Cara kerja input/proses/output, flowchart, pseudoCara kerja input/proses/output, flowchart, pseudo
Cara kerja input/proses/output, flowchart, pseudo
 
Assignments 150507052746-lva1-app6891
Assignments 150507052746-lva1-app6891Assignments 150507052746-lva1-app6891
Assignments 150507052746-lva1-app6891
 
Pengaturcaraan asas
Pengaturcaraan asasPengaturcaraan asas
Pengaturcaraan asas
 
Introduction to c programming
Introduction to c programmingIntroduction to c programming
Introduction to c programming
 
Introduction of c programming
Introduction of c programmingIntroduction of c programming
Introduction of c programming
 
Introduction to c programming
Introduction to c programmingIntroduction to c programming
Introduction to c programming
 
Introduction to Basic C programming 02
Introduction to Basic C programming 02Introduction to Basic C programming 02
Introduction to Basic C programming 02
 
4.0 projek pengaturcaraan
4.0 projek pengaturcaraan4.0 projek pengaturcaraan
4.0 projek pengaturcaraan
 
1.0 pengaturcaraan
1.0 pengaturcaraan1.0 pengaturcaraan
1.0 pengaturcaraan
 

Similar to Introduction to C Programming

presentation_data_types_and_operators_1513499834_241350.pptx
presentation_data_types_and_operators_1513499834_241350.pptxpresentation_data_types_and_operators_1513499834_241350.pptx
presentation_data_types_and_operators_1513499834_241350.pptx
KrishanPalSingh39
 
Ch2 introduction to c
Ch2 introduction to cCh2 introduction to c
Ch2 introduction to c
Hattori Sidek
 

Similar to Introduction to C Programming (20)

Introduction to C
Introduction to CIntroduction to C
Introduction to C
 
c programming session 1.pptx
c programming session 1.pptxc programming session 1.pptx
c programming session 1.pptx
 
C_Programming_Language_tutorial__Autosaved_.pptx
C_Programming_Language_tutorial__Autosaved_.pptxC_Programming_Language_tutorial__Autosaved_.pptx
C_Programming_Language_tutorial__Autosaved_.pptx
 
C Programming Unit-1
C Programming Unit-1C Programming Unit-1
C Programming Unit-1
 
Chapter3
Chapter3Chapter3
Chapter3
 
Getting started with c++
Getting started with c++Getting started with c++
Getting started with c++
 
Getting started with c++
Getting started with c++Getting started with c++
Getting started with c++
 
C programing Tutorial
C programing TutorialC programing Tutorial
C programing Tutorial
 
C prog ppt
C prog pptC prog ppt
C prog ppt
 
Cnotes
CnotesCnotes
Cnotes
 
presentation_data_types_and_operators_1513499834_241350.pptx
presentation_data_types_and_operators_1513499834_241350.pptxpresentation_data_types_and_operators_1513499834_241350.pptx
presentation_data_types_and_operators_1513499834_241350.pptx
 
Ch2 introduction to c
Ch2 introduction to cCh2 introduction to c
Ch2 introduction to c
 
Introduction to C Programming
Introduction to C ProgrammingIntroduction to C Programming
Introduction to C Programming
 
fds unit1.docx
fds unit1.docxfds unit1.docx
fds unit1.docx
 
C introduction
C introductionC introduction
C introduction
 
datatypes and variables in c language
 datatypes and variables in c language datatypes and variables in c language
datatypes and variables in c language
 
Mca i pic u-2 datatypes and variables in c language
Mca i pic u-2 datatypes and variables in c languageMca i pic u-2 datatypes and variables in c language
Mca i pic u-2 datatypes and variables in c language
 
Btech i pic u-2 datatypes and variables in c language
Btech i pic u-2 datatypes and variables in c languageBtech i pic u-2 datatypes and variables in c language
Btech i pic u-2 datatypes and variables in c language
 
Introduction%20C.pptx
Introduction%20C.pptxIntroduction%20C.pptx
Introduction%20C.pptx
 
Diploma ii cfpc u-2 datatypes and variables in c language
Diploma ii  cfpc u-2 datatypes and variables in c languageDiploma ii  cfpc u-2 datatypes and variables in c language
Diploma ii cfpc u-2 datatypes and variables in c language
 

Recently uploaded

Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
ciinovamais
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdf
Chris Hunter
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
heathfieldcps1
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
heathfieldcps1
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
QucHHunhnh
 

Recently uploaded (20)

Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdf
 
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural ResourcesEnergy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdf
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 

Introduction to C Programming

  • 2.
  • 3.
  • 4. Steps in learning C Character Set Programs Instructions Tokens
  • 5. C Character Set C Character Set Execution Character Set Source Character Set Special Characters Digits Alphabets Escape Sequence White Spaces
  • 6.
  • 7. Source Character Set Letters a to z ,A to Z Digits 0 to 9 Special Characters ! @ # $ % ^ & * ( ) _ - + = | { } [ ] etc,. White Spaces Blank Space ,Horizontal tab, New line, Vertical tab etc,.
  • 8.
  • 9.
  • 10. Executable Character Set Characters Escape Sequence Back Space Horizontal Space Vertical Space Newline
  • 11.
  • 12. C Tokens (Cont) C Tokens Identifiers Eg:main, avg Keywords Eg: int, for operators Eg: + - Strings Eg: “ab” spI symbol Eg: # $ % Constants Eg:17, 15.5
  • 13. Executing a C Program Creating the Program Compilation Linking Execution
  • 14.
  • 15.
  • 16. Structure of C program DOCUMENTATION SECTION PREPROCESSOR SECTION DEFINITION SECTION GLOBAL DECLARATION SECTION main() { Declaration part; Executable Part; } sub program section { Body of the subprogram; }
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.
  • 23.
  • 24.
  • 25.
  • 26. Examples of Valid and Invalid Names
  • 27.
  • 28.
  • 29.
  • 30.
  • 31.
  • 32. Constants Constants Character Constants Numeric Constants Real Constant Integer Constant String Constant Single Character Constant
  • 33.
  • 34.
  • 35.
  • 36.
  • 37.
  • 38.
  • 39.
  • 40. Standard Data Types These Standard type can be used to build more complex data types called Derived Types (e.g. pointers, array, union etc.).
  • 41. Data types Data type Size(bytes) Range Format string Char 1 -128 to 127 %c int 2 -32,768 to 32,767 %d Float 4 3.4 e-38 to 3.4 e+38 %f Double 8 1.7 e-308 to 1.7 e+308 %lf
  • 42.
  • 43.
  • 44.
  • 45.
  • 46.
  • 47. Entire Data types in c: Data type Size(bytes) Range Format string Char 1 128 to 127 %c Unsigned char 1 0 to 255 %c Short or int 2 -32,768 to 32,767 %i or %d Unsigned int 2 0 to 65535 %u Long 4 -2147483648 to 2147483647 %ld Unsigned long 4 0 to 4294967295 %lu Float 4 3.4 e-38 to 3.4 e+38 %f or %g Double 8 1.7 e-308 to 1.7 e+308 %lf Long Double 10 3.4 e-4932 to 1.1 e+4932 %lf
  • 48.
  • 49.
  • 50.
  • 51. Division operator on Different Data Type Operation Result Example int/int int 5/2 = 2 int/real real 5/2.0 = 2.5 real/int real 5.0/2 = 2.5 real/real real 5.0/2.0 = 2.5
  • 52.
  • 53.
  • 54.
  • 55.
  • 56.
  • 57.
  • 58.
  • 59.
  • 60.
  • 61.
  • 62.
  • 63.
  • 64.
  • 65.
  • 66.
  • 67.
  • 68.
  • 69.
  • 70.
  • 71.
  • 72.
  • 73.
  • 74.
  • 75.
  • 76. Precedence Operator High * , / , % Low + , -
  • 77.
  • 78.
  • 79.
  • 80.
  • 81. Input/Output Function Input/Output Function Unformatted Formatted Output printf() fprintf() Input scanf() fscanf() Input getc() gets() getchar() Output putc() puts() putchar()
  • 82.
  • 83. Formatted Input and Output
  • 84.
  • 85. Format of printf Statement
  • 86.
  • 87. Format of scanf Statement
  • 88.
  • 89.  
  • 90.
  • 91.
  • 92.
  • 93.
  • 94.
  • 95.
  • 96.
  • 97.
  • 98. NESTED IF… ELSE If Condition 1 False Statements True If Condition 2 True False True statements False statements
  • 99.
  • 100. IF…ELSE LADDER Condition 1 Statements Condition 2 Statements Condition 3 Statements Statements TRUE TRUE TRUE FALSE FALSE FALSE
  • 101.
  • 102.
  • 103.
  • 104.
  • 105.
  • 106.
  • 107.
  • 108.
  • 109.
  • 110.
  • 111. for loop Initialization condition False Body of the loop Inc / Decrement
  • 112.
  • 113.
  • 114.
  • 115. CASE structure Case 1 Case 2 Default case Switch
  • 116.
  • 117.
  • 118.
  • 119.
  • 120.
  • 121.
  • 122.
  • 123.
  • 124.
  • 125.
  • 126.
  • 127.
  • 128.
  • 129.
  • 130.
  • 131.  
  • 132.
  • 133.
  • 134.
  • 135.
  • 136.
  • 137.
  • 138.
  • 139.
  • 140.
  • 141.
  • 142.
  • 143.
  • 144.
  • 145.
  • 146.
  • 147.
  • 148.
  • 149.
  • 150.
  • 151.
  • 152.
  • 153.
  • 154.
  • 155.
  • 156.
  • 157.
  • 158.
  • 159.
  • 160.
  • 161.
  • 162.
  • 163.
  • 164.