SlideShare a Scribd company logo
1 of 13
150990119011 – KAGZI MOHAMMAD UZAIR
150990119012 – ABHIJEET KHER
150990119013 – MALEK MOIN
150990119014 – TANMAY MANDALIYA
150990119015 – PRATIJEETSINH MANGROLIA
CONTROL STRUCTURE OF C LANGUAGE
BY : -
It is a two-way decision statement. depending on whether the value
of expression is 'true' or 'false', it transfers the control to a particular
statement.
Syntax:
if(test expression)
{
true-block
statements;
}
statement-x;
IF TEST
EXPRESS
ION
?
STATEMENT
STATEMENT X
NO
YES
This statement is simply an If statement embedded with an If
statement. This allows us to perform multiple actions in a single
instruction.
The general form is:
If (test expression1)
{
if (test expression2)
{
statement -1;
}
else
{
statement -2;
}
}
else
{
Statement -3;
}
Statement –x;
If
Exp.
1
Stmt. 3
Stmt. 1
Stmt. x
Stmt. 2
If
Exp.
2
False
False
True
True
We use if statement to choose one of the many alternatives. But as the
number of alternative increases, the complexity of such a program also
increases. Thus, to make it simpler, C has a multi-way decision statement
known as switch.
a case expression can be repeatedly used in a switch statement. That is, it
allows several alternate courses of actions and choose one to be executed at
runtime.
The use of break statement in every case is used to quit the switch
statement after a particular case is matched. Thus only one case gets executed.
If the break statement is not used, then all the statement following the
matched case will get executed. Thus statement is compulsory for the proper
execution of the switch statement.
SYNTEX…
Switch (expression)
{
case value – 1 : // value -1 is a constant and is known as case label.
statement1;
Break; // end of case
case value – 2 // case labels end with a colon(:).
statement1;
break;
default: // optional
default – statement;
break;
}
Statement – x;
The break statement is used to jump out of a loop.
An early exit from a loop can be accomplished using the
break statement. When a break statement is encountered inside
a loop, the loop is immediately exited and the program
continues with the statement immediately following the loop.
The general forms are:
While (.......)
{
...............
...............
if (condition)
Break;
................
................
}
.....................................
do
{
…………..
…………..
if (condition)
Break;
………………..
……………
} While (……………………)
……………………..
For(…………..)
{
…………….
…………….
if(condition)
break;
……………..
…………………
}
……………………………..
Sometimes, in loop iterations, it may be necessary to skip
some statements in that loop and start the next iteration
of that same loop. For such situation, C provides continue
statement.
The continue statement causes the loop to continue with
the next iteration skipping the remaining statement in
that loop.
do for (;;)
{ {
……………. ……………….
if ( ) if ( )
continue; continue;
……………… ……………..
….………….. ……………..
} while ( ); }
Control structure of c language

More Related Content

What's hot

Loops and conditional statements
Loops and conditional statementsLoops and conditional statements
Loops and conditional statementsSaad Sheikh
 
Decision making and branching in c programming
Decision making and branching in c programmingDecision making and branching in c programming
Decision making and branching in c programmingPriyansh Thakar
 
Decision Making Statement in C ppt
Decision Making Statement in C pptDecision Making Statement in C ppt
Decision Making Statement in C pptMANJUTRIPATHI7
 
Nesting of if else statement & Else If Ladder
Nesting of if else statement & Else If Ladder Nesting of if else statement & Else If Ladder
Nesting of if else statement & Else If Ladder Vishvesh Jasani
 
Conditional Statement in C Language
Conditional Statement in C LanguageConditional Statement in C Language
Conditional Statement in C LanguageShaina Arora
 
C decision making and looping.
C decision making and looping.C decision making and looping.
C decision making and looping.Haard Shah
 
Selection Statements in C Programming
Selection Statements in C ProgrammingSelection Statements in C Programming
Selection Statements in C ProgrammingKamal Acharya
 
C lecture 3 control statements slideshare
C lecture 3 control statements slideshareC lecture 3 control statements slideshare
C lecture 3 control statements slideshareGagan Deep
 
Decision Making and Branching in C
Decision Making and Branching  in CDecision Making and Branching  in C
Decision Making and Branching in CRAJ KUMAR
 
Decision making statements in C programming
Decision making statements in C programmingDecision making statements in C programming
Decision making statements in C programmingRabin BK
 
Control Flow Statements
Control Flow Statements Control Flow Statements
Control Flow Statements Tarun Sharma
 
5 c control statements looping
5  c control statements looping5  c control statements looping
5 c control statements loopingMomenMostafa
 
Control statements and functions in c
Control statements and functions in cControl statements and functions in c
Control statements and functions in cvampugani
 
Control Structures
Control StructuresControl Structures
Control StructuresGhaffar Khan
 
Control and conditional statements
Control and conditional statementsControl and conditional statements
Control and conditional statementsrajshreemuthiah
 
Conditional statement c++
Conditional statement c++Conditional statement c++
Conditional statement c++amber chaudary
 
C programming decision making
C programming decision makingC programming decision making
C programming decision makingSENA
 
If statements in c programming
If statements in c programmingIf statements in c programming
If statements in c programmingArchana Gopinath
 

What's hot (20)

Loops and conditional statements
Loops and conditional statementsLoops and conditional statements
Loops and conditional statements
 
Decision making and branching in c programming
Decision making and branching in c programmingDecision making and branching in c programming
Decision making and branching in c programming
 
Decision Making Statement in C ppt
Decision Making Statement in C pptDecision Making Statement in C ppt
Decision Making Statement in C ppt
 
CONDITIONAL STATEMENT IN C LANGUAGE
CONDITIONAL STATEMENT IN C LANGUAGECONDITIONAL STATEMENT IN C LANGUAGE
CONDITIONAL STATEMENT IN C LANGUAGE
 
Nesting of if else statement & Else If Ladder
Nesting of if else statement & Else If Ladder Nesting of if else statement & Else If Ladder
Nesting of if else statement & Else If Ladder
 
Conditional Statement in C Language
Conditional Statement in C LanguageConditional Statement in C Language
Conditional Statement in C Language
 
C decision making and looping.
C decision making and looping.C decision making and looping.
C decision making and looping.
 
Selection Statements in C Programming
Selection Statements in C ProgrammingSelection Statements in C Programming
Selection Statements in C Programming
 
Decision making and branching
Decision making and branchingDecision making and branching
Decision making and branching
 
C lecture 3 control statements slideshare
C lecture 3 control statements slideshareC lecture 3 control statements slideshare
C lecture 3 control statements slideshare
 
Decision Making and Branching in C
Decision Making and Branching  in CDecision Making and Branching  in C
Decision Making and Branching in C
 
Decision making statements in C programming
Decision making statements in C programmingDecision making statements in C programming
Decision making statements in C programming
 
Control Flow Statements
Control Flow Statements Control Flow Statements
Control Flow Statements
 
5 c control statements looping
5  c control statements looping5  c control statements looping
5 c control statements looping
 
Control statements and functions in c
Control statements and functions in cControl statements and functions in c
Control statements and functions in c
 
Control Structures
Control StructuresControl Structures
Control Structures
 
Control and conditional statements
Control and conditional statementsControl and conditional statements
Control and conditional statements
 
Conditional statement c++
Conditional statement c++Conditional statement c++
Conditional statement c++
 
C programming decision making
C programming decision makingC programming decision making
C programming decision making
 
If statements in c programming
If statements in c programmingIf statements in c programming
If statements in c programming
 

Similar to Control structure of c language

2. Control structures with for while and do while.ppt
2. Control structures with for while and do while.ppt2. Control structures with for while and do while.ppt
2. Control structures with for while and do while.pptManojKhadilkar1
 
C++ programming Unit 5 flow of control
C++ programming Unit 5 flow of controlC++ programming Unit 5 flow of control
C++ programming Unit 5 flow of controlAAKASH KUMAR
 
C statements
C statementsC statements
C statementsAhsann111
 
Chapter 4(1)
Chapter 4(1)Chapter 4(1)
Chapter 4(1)TejaswiB4
 
Selection statements
Selection statementsSelection statements
Selection statementsHarsh Dabas
 
Programming in java - Concepts- Operators- Control statements-Expressions
Programming in java - Concepts- Operators- Control statements-ExpressionsProgramming in java - Concepts- Operators- Control statements-Expressions
Programming in java - Concepts- Operators- Control statements-ExpressionsLovelitJose
 
Do While Repetition Structure
Do While Repetition StructureDo While Repetition Structure
Do While Repetition StructureShahzu2
 
Mca i pic u-3 handling input output and control statements
Mca i pic u-3 handling input output and control statementsMca i pic u-3 handling input output and control statements
Mca i pic u-3 handling input output and control statementsRai University
 
Btech i pic u-3 handling input output and control statements
Btech i pic u-3 handling input output and control statementsBtech i pic u-3 handling input output and control statements
Btech i pic u-3 handling input output and control statementsRai University
 
handling input output and control statements
 handling input output and control statements handling input output and control statements
handling input output and control statementsRai University
 
Decision making and looping - c programming by YEASIN NEWAJ
Decision making and looping -  c programming by YEASIN NEWAJDecision making and looping -  c programming by YEASIN NEWAJ
Decision making and looping - c programming by YEASIN NEWAJYeasinNewaj
 
Bansal presentation (1).pptx
Bansal presentation (1).pptxBansal presentation (1).pptx
Bansal presentation (1).pptxAbhiYadav655132
 
Diploma ii cfpc u-3 handling input output and control statements
Diploma ii  cfpc u-3 handling input output and control statementsDiploma ii  cfpc u-3 handling input output and control statements
Diploma ii cfpc u-3 handling input output and control statementsRai University
 
Flow of control by deepak lakhlan
Flow of control by deepak lakhlanFlow of control by deepak lakhlan
Flow of control by deepak lakhlanDeepak Lakhlan
 

Similar to Control structure of c language (20)

Chap 5(decision making-branching)
Chap 5(decision making-branching)Chap 5(decision making-branching)
Chap 5(decision making-branching)
 
C++ STATEMENTS
C++ STATEMENTS C++ STATEMENTS
C++ STATEMENTS
 
2. Control structures with for while and do while.ppt
2. Control structures with for while and do while.ppt2. Control structures with for while and do while.ppt
2. Control structures with for while and do while.ppt
 
C++ programming Unit 5 flow of control
C++ programming Unit 5 flow of controlC++ programming Unit 5 flow of control
C++ programming Unit 5 flow of control
 
C statements
C statementsC statements
C statements
 
Chapter 4(1)
Chapter 4(1)Chapter 4(1)
Chapter 4(1)
 
Selection statements
Selection statementsSelection statements
Selection statements
 
Flow of Control
Flow of ControlFlow of Control
Flow of Control
 
Programming in java - Concepts- Operators- Control statements-Expressions
Programming in java - Concepts- Operators- Control statements-ExpressionsProgramming in java - Concepts- Operators- Control statements-Expressions
Programming in java - Concepts- Operators- Control statements-Expressions
 
CONTROL STMTS.pptx
CONTROL STMTS.pptxCONTROL STMTS.pptx
CONTROL STMTS.pptx
 
Do While Repetition Structure
Do While Repetition StructureDo While Repetition Structure
Do While Repetition Structure
 
Mca i pic u-3 handling input output and control statements
Mca i pic u-3 handling input output and control statementsMca i pic u-3 handling input output and control statements
Mca i pic u-3 handling input output and control statements
 
Computer programming 2 Lesson 9
Computer programming 2  Lesson 9Computer programming 2  Lesson 9
Computer programming 2 Lesson 9
 
Computer programming 2 - Lesson 7
Computer programming 2 - Lesson 7Computer programming 2 - Lesson 7
Computer programming 2 - Lesson 7
 
Btech i pic u-3 handling input output and control statements
Btech i pic u-3 handling input output and control statementsBtech i pic u-3 handling input output and control statements
Btech i pic u-3 handling input output and control statements
 
handling input output and control statements
 handling input output and control statements handling input output and control statements
handling input output and control statements
 
Decision making and looping - c programming by YEASIN NEWAJ
Decision making and looping -  c programming by YEASIN NEWAJDecision making and looping -  c programming by YEASIN NEWAJ
Decision making and looping - c programming by YEASIN NEWAJ
 
Bansal presentation (1).pptx
Bansal presentation (1).pptxBansal presentation (1).pptx
Bansal presentation (1).pptx
 
Diploma ii cfpc u-3 handling input output and control statements
Diploma ii  cfpc u-3 handling input output and control statementsDiploma ii  cfpc u-3 handling input output and control statements
Diploma ii cfpc u-3 handling input output and control statements
 
Flow of control by deepak lakhlan
Flow of control by deepak lakhlanFlow of control by deepak lakhlan
Flow of control by deepak lakhlan
 

More from Digvijaysinh Gohil

Traits of a good listner (Communication Skills)
Traits of a good listner (Communication Skills)Traits of a good listner (Communication Skills)
Traits of a good listner (Communication Skills)Digvijaysinh Gohil
 
Techniques of reading (Communication Skills)
Techniques of reading (Communication Skills)Techniques of reading (Communication Skills)
Techniques of reading (Communication Skills)Digvijaysinh Gohil
 
Proxemics (Communication Skills)
Proxemics (Communication Skills)Proxemics (Communication Skills)
Proxemics (Communication Skills)Digvijaysinh Gohil
 
Proxemics (2) (Communication Skills)
Proxemics (2) (Communication Skills)Proxemics (2) (Communication Skills)
Proxemics (2) (Communication Skills)Digvijaysinh Gohil
 
Paralinguistic (Communication Skills)
Paralinguistic (Communication Skills)Paralinguistic (Communication Skills)
Paralinguistic (Communication Skills)Digvijaysinh Gohil
 
Paralinguistic (2) (Communication Skills)
Paralinguistic (2) (Communication Skills)Paralinguistic (2) (Communication Skills)
Paralinguistic (2) (Communication Skills)Digvijaysinh Gohil
 
Paralinguistic (1) (Communication Skills)
Paralinguistic (1) (Communication Skills)Paralinguistic (1) (Communication Skills)
Paralinguistic (1) (Communication Skills)Digvijaysinh Gohil
 
Organizing a contents & preparing an outline
Organizing a contents & preparing an outlineOrganizing a contents & preparing an outline
Organizing a contents & preparing an outlineDigvijaysinh Gohil
 
Organizing a contents & preparing an outline (2)
Organizing a contents & preparing an outline (2)Organizing a contents & preparing an outline (2)
Organizing a contents & preparing an outline (2)Digvijaysinh Gohil
 
Kinesics (Communication Skills)
Kinesics (Communication Skills)Kinesics (Communication Skills)
Kinesics (Communication Skills)Digvijaysinh Gohil
 
Kinesics (3) (Communication Skills)
Kinesics (3) (Communication Skills)Kinesics (3) (Communication Skills)
Kinesics (3) (Communication Skills)Digvijaysinh Gohil
 
Kinesics (2) (Communication Skills)
Kinesics (2) (Communication Skills)Kinesics (2) (Communication Skills)
Kinesics (2) (Communication Skills)Digvijaysinh Gohil
 
Introduction to communication (Communication Skills)
Introduction to communication (Communication Skills)Introduction to communication (Communication Skills)
Introduction to communication (Communication Skills)Digvijaysinh Gohil
 
Email etiquette (Communication Skills)
Email etiquette (Communication Skills)Email etiquette (Communication Skills)
Email etiquette (Communication Skills)Digvijaysinh Gohil
 
Welded joints (machine design & industrial drafting )
Welded joints (machine design & industrial drafting )Welded joints (machine design & industrial drafting )
Welded joints (machine design & industrial drafting )Digvijaysinh Gohil
 
Types of stresses and theories of failure (machine design & industrial drafti...
Types of stresses and theories of failure (machine design & industrial drafti...Types of stresses and theories of failure (machine design & industrial drafti...
Types of stresses and theories of failure (machine design & industrial drafti...Digvijaysinh Gohil
 
Treaded joint (machine design & industrial drafting )
Treaded joint (machine design & industrial drafting )Treaded joint (machine design & industrial drafting )
Treaded joint (machine design & industrial drafting )Digvijaysinh Gohil
 

More from Digvijaysinh Gohil (20)

Hydraulic cranes
Hydraulic cranesHydraulic cranes
Hydraulic cranes
 
Hydraulic braking systems
Hydraulic braking systemsHydraulic braking systems
Hydraulic braking systems
 
Human resources management
Human resources managementHuman resources management
Human resources management
 
Traits of a good listner (Communication Skills)
Traits of a good listner (Communication Skills)Traits of a good listner (Communication Skills)
Traits of a good listner (Communication Skills)
 
Techniques of reading (Communication Skills)
Techniques of reading (Communication Skills)Techniques of reading (Communication Skills)
Techniques of reading (Communication Skills)
 
Proxemics (Communication Skills)
Proxemics (Communication Skills)Proxemics (Communication Skills)
Proxemics (Communication Skills)
 
Proxemics (2) (Communication Skills)
Proxemics (2) (Communication Skills)Proxemics (2) (Communication Skills)
Proxemics (2) (Communication Skills)
 
Paralinguistic (Communication Skills)
Paralinguistic (Communication Skills)Paralinguistic (Communication Skills)
Paralinguistic (Communication Skills)
 
Paralinguistic (2) (Communication Skills)
Paralinguistic (2) (Communication Skills)Paralinguistic (2) (Communication Skills)
Paralinguistic (2) (Communication Skills)
 
Paralinguistic (1) (Communication Skills)
Paralinguistic (1) (Communication Skills)Paralinguistic (1) (Communication Skills)
Paralinguistic (1) (Communication Skills)
 
Organizing a contents & preparing an outline
Organizing a contents & preparing an outlineOrganizing a contents & preparing an outline
Organizing a contents & preparing an outline
 
Organizing a contents & preparing an outline (2)
Organizing a contents & preparing an outline (2)Organizing a contents & preparing an outline (2)
Organizing a contents & preparing an outline (2)
 
Kinesics (Communication Skills)
Kinesics (Communication Skills)Kinesics (Communication Skills)
Kinesics (Communication Skills)
 
Kinesics (3) (Communication Skills)
Kinesics (3) (Communication Skills)Kinesics (3) (Communication Skills)
Kinesics (3) (Communication Skills)
 
Kinesics (2) (Communication Skills)
Kinesics (2) (Communication Skills)Kinesics (2) (Communication Skills)
Kinesics (2) (Communication Skills)
 
Introduction to communication (Communication Skills)
Introduction to communication (Communication Skills)Introduction to communication (Communication Skills)
Introduction to communication (Communication Skills)
 
Email etiquette (Communication Skills)
Email etiquette (Communication Skills)Email etiquette (Communication Skills)
Email etiquette (Communication Skills)
 
Welded joints (machine design & industrial drafting )
Welded joints (machine design & industrial drafting )Welded joints (machine design & industrial drafting )
Welded joints (machine design & industrial drafting )
 
Types of stresses and theories of failure (machine design & industrial drafti...
Types of stresses and theories of failure (machine design & industrial drafti...Types of stresses and theories of failure (machine design & industrial drafti...
Types of stresses and theories of failure (machine design & industrial drafti...
 
Treaded joint (machine design & industrial drafting )
Treaded joint (machine design & industrial drafting )Treaded joint (machine design & industrial drafting )
Treaded joint (machine design & industrial drafting )
 

Recently uploaded

High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...ranjana rawat
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSISrknatarajan
 
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingUNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingrknatarajan
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxupamatechverse
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...ranjana rawat
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptxBSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptxfenichawla
 
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...Call Girls in Nagpur High Profile
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Dr.Costas Sachpazis
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxpranjaldaimarysona
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingrakeshbaidya232001
 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Bookingdharasingh5698
 
UNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular ConduitsUNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular Conduitsrknatarajan
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Dr.Costas Sachpazis
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdfankushspencer015
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINESIVASHANKAR N
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Christo Ananth
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Call Girls in Nagpur High Profile
 

Recently uploaded (20)

High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSIS
 
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingUNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptx
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
 
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptxBSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
 
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptx
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writing
 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
 
UNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular ConduitsUNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular Conduits
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdf
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
 

Control structure of c language

  • 1. 150990119011 – KAGZI MOHAMMAD UZAIR 150990119012 – ABHIJEET KHER 150990119013 – MALEK MOIN 150990119014 – TANMAY MANDALIYA 150990119015 – PRATIJEETSINH MANGROLIA CONTROL STRUCTURE OF C LANGUAGE BY : -
  • 2. It is a two-way decision statement. depending on whether the value of expression is 'true' or 'false', it transfers the control to a particular statement.
  • 4. This statement is simply an If statement embedded with an If statement. This allows us to perform multiple actions in a single instruction.
  • 5. The general form is: If (test expression1) { if (test expression2) { statement -1; } else { statement -2; } } else { Statement -3; } Statement –x;
  • 6. If Exp. 1 Stmt. 3 Stmt. 1 Stmt. x Stmt. 2 If Exp. 2 False False True True
  • 7. We use if statement to choose one of the many alternatives. But as the number of alternative increases, the complexity of such a program also increases. Thus, to make it simpler, C has a multi-way decision statement known as switch. a case expression can be repeatedly used in a switch statement. That is, it allows several alternate courses of actions and choose one to be executed at runtime. The use of break statement in every case is used to quit the switch statement after a particular case is matched. Thus only one case gets executed. If the break statement is not used, then all the statement following the matched case will get executed. Thus statement is compulsory for the proper execution of the switch statement.
  • 8. SYNTEX… Switch (expression) { case value – 1 : // value -1 is a constant and is known as case label. statement1; Break; // end of case case value – 2 // case labels end with a colon(:). statement1; break; default: // optional default – statement; break; } Statement – x;
  • 9. The break statement is used to jump out of a loop. An early exit from a loop can be accomplished using the break statement. When a break statement is encountered inside a loop, the loop is immediately exited and the program continues with the statement immediately following the loop.
  • 10. The general forms are: While (.......) { ............... ............... if (condition) Break; ................ ................ } ..................................... do { ………….. ………….. if (condition) Break; ……………….. …………… } While (……………………) …………………….. For(…………..) { ……………. ……………. if(condition) break; …………….. ………………… } ……………………………..
  • 11. Sometimes, in loop iterations, it may be necessary to skip some statements in that loop and start the next iteration of that same loop. For such situation, C provides continue statement. The continue statement causes the loop to continue with the next iteration skipping the remaining statement in that loop.
  • 12. do for (;;) { { ……………. ………………. if ( ) if ( ) continue; continue; ……………… …………….. ….………….. …………….. } while ( ); }