SlideShare ist ein Scribd-Unternehmen logo
1 von 22
Control Structures A Lecture By Abdul Ghaffar Khan
Control Structure ,[object Object],[object Object],[object Object],[object Object]
Sequential logic: ,[object Object]
Selection logic ,[object Object]
Iteration logic: ,[object Object]
The if statement: ,[object Object]
The if statement: ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
The if statement:  ( Example 7.1) ,[object Object],[object Object],[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 7.2 ,[object Object]
Example 7.2 ,[object Object],[object Object],[object Object],[object Object],[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: 1)  Enter Quantity in liters 25 : Discount is Rs 37.50  Your bill amount is Rs 712.50 2) Enter Quantity in liters 10 Discount is Rs. 0.00 Your bill amount is Rs.300.00
The  if-else   statement: ,[object Object]
The  if-else   statement: ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
The  if-else   statement:  (Example 7.3 Quadratic Equation )
The  if-else   statement:  (Example 7.3 Quadratic Equation ) #include <stdio.h> #include <conio.h>  #include <math.h> void main(void) { int a, b, c; double d, x1, x2; //clrscr(); printf(&quot;Input a=&quot;); scanf(&quot;%d&quot;,&a); printf(&quot;input b = &quot;); scanf(&quot;%d&quot;,&b ); printf(&quot;input c = &quot;); scanf(&quot;%d&quot;,&c ); d = b*b -4*a*c; if (d<0)  {  printf(&quot;Roots are not real&quot;); printf(&quot;Enter some other values of a, band c&quot;); } else { x1 = ( -b - sqrt( d )) / (2 * a); x2 = ( -b + sqrt( d )) / (2 * a); printf(&quot;First Root is %.2f&quot;,x1); printf(&quot;Second Root is %.2f&quot;,x2); }  getch(); }
The Nested  if   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]
The  else-if   Structure: ,[object Object],if (boolean_expression I) { statement_set1 ; } else if (boolean_exp2)   {   statement set2;   }
[object Object],[object Object]
Example 7.4
The switch Statement ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Conditional Operator ?: ,[object Object],[object Object],[object Object]
Example 7.6 ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Example 7.7 ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]

Weitere ähnliche Inhalte

Was ist angesagt?

08 c++ Operator Overloading.ppt
08 c++ Operator Overloading.ppt08 c++ Operator Overloading.ppt
08 c++ Operator Overloading.pptTareq Hasan
 
friend function(c++)
friend function(c++)friend function(c++)
friend function(c++)Ritika Sharma
 
Conditional and control statement
Conditional and control statementConditional and control statement
Conditional and control statementnarmadhakin
 
Control structures in C++ Programming Language
Control structures in C++ Programming LanguageControl structures in C++ Programming Language
Control structures in C++ Programming LanguageAhmad Idrees
 
Operator Overloading
Operator OverloadingOperator Overloading
Operator OverloadingNilesh Dalvi
 
Java abstract class & abstract methods
Java abstract class & abstract methodsJava abstract class & abstract methods
Java abstract class & abstract methodsShubham Dwivedi
 
Presentation on C Switch Case Statements
Presentation on C Switch Case StatementsPresentation on C Switch Case Statements
Presentation on C Switch Case StatementsDipesh Pandey
 
Java Data Types
Java Data TypesJava Data Types
Java Data TypesSpotle.ai
 
C Programming: Control Structure
C Programming: Control StructureC Programming: Control Structure
C Programming: Control StructureSokngim Sa
 
Inheritance in c++
Inheritance in c++Inheritance in c++
Inheritance in c++Vineeta Garg
 
Class and object in C++
Class and object in C++Class and object in C++
Class and object in C++rprajat007
 
Exceptions in Java
Exceptions in JavaExceptions in Java
Exceptions in JavaVadym Lotar
 
Structures in c language
Structures in c languageStructures in c language
Structures in c languagetanmaymodi4
 
data types in C programming
data types in C programmingdata types in C programming
data types in C programmingHarshita Yadav
 

Was ist angesagt? (20)

08 c++ Operator Overloading.ppt
08 c++ Operator Overloading.ppt08 c++ Operator Overloading.ppt
08 c++ Operator Overloading.ppt
 
friend function(c++)
friend function(c++)friend function(c++)
friend function(c++)
 
Conditional and control statement
Conditional and control statementConditional and control statement
Conditional and control statement
 
Control structures in C++ Programming Language
Control structures in C++ Programming LanguageControl structures in C++ Programming Language
Control structures in C++ Programming Language
 
Control structures in c
Control structures in cControl structures in c
Control structures in c
 
Operator Overloading
Operator OverloadingOperator Overloading
Operator Overloading
 
Modular programming
Modular programmingModular programming
Modular programming
 
Java abstract class & abstract methods
Java abstract class & abstract methodsJava abstract class & abstract methods
Java abstract class & abstract methods
 
Presentation on C Switch Case Statements
Presentation on C Switch Case StatementsPresentation on C Switch Case Statements
Presentation on C Switch Case Statements
 
Java Data Types
Java Data TypesJava Data Types
Java Data Types
 
Control statements in c
Control statements in cControl statements in c
Control statements in c
 
Pointers in c++
Pointers in c++Pointers in c++
Pointers in c++
 
C Programming: Control Structure
C Programming: Control StructureC Programming: Control Structure
C Programming: Control Structure
 
Data types in C
Data types in CData types in C
Data types in C
 
Inheritance in c++
Inheritance in c++Inheritance in c++
Inheritance in c++
 
Class and object in C++
Class and object in C++Class and object in C++
Class and object in C++
 
Exceptions in Java
Exceptions in JavaExceptions in Java
Exceptions in Java
 
Structures in c language
Structures in c languageStructures in c language
Structures in c language
 
data types in C programming
data types in C programmingdata types in C programming
data types in C programming
 
Arrays in Java
Arrays in JavaArrays in Java
Arrays in Java
 

Ähnlich wie Control Structures

C language UPTU Unit3 Slides
C language UPTU Unit3 SlidesC language UPTU Unit3 Slides
C language UPTU Unit3 SlidesRakesh Roshan
 
C statements.ppt presentation in c language
C statements.ppt presentation in c languageC statements.ppt presentation in c language
C statements.ppt presentation in c languagechintupro9
 
Control statements-Computer programming
Control statements-Computer programmingControl statements-Computer programming
Control statements-Computer programmingnmahi96
 
Dti2143 chap 4 control structures aka_selection
Dti2143 chap 4 control structures aka_selectionDti2143 chap 4 control structures aka_selection
Dti2143 chap 4 control structures aka_selectionalish sha
 
Dti2143 chap 4 control structures aka_selection
Dti2143 chap 4 control structures aka_selectionDti2143 chap 4 control structures aka_selection
Dti2143 chap 4 control structures aka_selectionalish sha
 
C programming decision making
C programming decision makingC programming decision making
C programming decision makingSENA
 
Introduction to computer programming (C)-CSC1205_Lec5_Flow control
Introduction to computer programming (C)-CSC1205_Lec5_Flow controlIntroduction to computer programming (C)-CSC1205_Lec5_Flow control
Introduction to computer programming (C)-CSC1205_Lec5_Flow controlENGWAU TONNY
 
C UNIT-2 PREPARED Y M V BRAHMANANDA REDDY
C UNIT-2 PREPARED Y M V BRAHMANANDA REDDYC UNIT-2 PREPARED Y M V BRAHMANANDA REDDY
C UNIT-2 PREPARED Y M V BRAHMANANDA REDDYRajeshkumar Reddy
 
Chapter 4 flow control structures and arrays
Chapter 4 flow control structures and arraysChapter 4 flow control structures and arrays
Chapter 4 flow control structures and arrayssshhzap
 
Claguage 110226222227-phpapp02
Claguage 110226222227-phpapp02Claguage 110226222227-phpapp02
Claguage 110226222227-phpapp02CIMAP
 
Flow of control C ++ By TANUJ
Flow of control C ++ By TANUJFlow of control C ++ By TANUJ
Flow of control C ++ By TANUJTANUJ ⠀
 
Control Structures in C
Control Structures in CControl Structures in C
Control Structures in Csana shaikh
 

Ähnlich wie Control Structures (20)

C Programming Unit-2
C Programming Unit-2C Programming Unit-2
C Programming Unit-2
 
C language UPTU Unit3 Slides
C language UPTU Unit3 SlidesC language UPTU Unit3 Slides
C language UPTU Unit3 Slides
 
C statements.ppt presentation in c language
C statements.ppt presentation in c languageC statements.ppt presentation in c language
C statements.ppt presentation in c language
 
Control statements-Computer programming
Control statements-Computer programmingControl statements-Computer programming
Control statements-Computer programming
 
Programming in Arduino (Part 2)
Programming in Arduino  (Part 2)Programming in Arduino  (Part 2)
Programming in Arduino (Part 2)
 
Dti2143 chap 4 control structures aka_selection
Dti2143 chap 4 control structures aka_selectionDti2143 chap 4 control structures aka_selection
Dti2143 chap 4 control structures aka_selection
 
Dti2143 chap 4 control structures aka_selection
Dti2143 chap 4 control structures aka_selectionDti2143 chap 4 control structures aka_selection
Dti2143 chap 4 control structures aka_selection
 
C programming decision making
C programming decision makingC programming decision making
C programming decision making
 
Introduction to computer programming (C)-CSC1205_Lec5_Flow control
Introduction to computer programming (C)-CSC1205_Lec5_Flow controlIntroduction to computer programming (C)-CSC1205_Lec5_Flow control
Introduction to computer programming (C)-CSC1205_Lec5_Flow control
 
Ch04
Ch04Ch04
Ch04
 
C UNIT-2 PREPARED Y M V BRAHMANANDA REDDY
C UNIT-2 PREPARED Y M V BRAHMANANDA REDDYC UNIT-2 PREPARED Y M V BRAHMANANDA REDDY
C UNIT-2 PREPARED Y M V BRAHMANANDA REDDY
 
7 decision-control
7 decision-control7 decision-control
7 decision-control
 
Chapter 4 flow control structures and arrays
Chapter 4 flow control structures and arraysChapter 4 flow control structures and arrays
Chapter 4 flow control structures and arrays
 
Control statments in c
Control statments in cControl statments in c
Control statments in c
 
Flow of Control
Flow of ControlFlow of Control
Flow of Control
 
Flow of control ppt
Flow of control pptFlow of control ppt
Flow of control ppt
 
CH-4 (1).pptx
CH-4 (1).pptxCH-4 (1).pptx
CH-4 (1).pptx
 
Claguage 110226222227-phpapp02
Claguage 110226222227-phpapp02Claguage 110226222227-phpapp02
Claguage 110226222227-phpapp02
 
Flow of control C ++ By TANUJ
Flow of control C ++ By TANUJFlow of control C ++ By TANUJ
Flow of control C ++ By TANUJ
 
Control Structures in C
Control Structures in CControl Structures in C
Control Structures in C
 

Mehr von Ghaffar Khan

World is beautiful ... ...
World is beautiful ... ...World is beautiful ... ...
World is beautiful ... ...Ghaffar Khan
 
My Presentation On Ajax
My Presentation On AjaxMy Presentation On Ajax
My Presentation On AjaxGhaffar Khan
 
How A Computer Works
How A Computer WorksHow A Computer Works
How A Computer WorksGhaffar Khan
 
Exponential and Logarthmic funtions
Exponential and Logarthmic funtionsExponential and Logarthmic funtions
Exponential and Logarthmic funtionsGhaffar Khan
 
Exponential and Logarthmic funtions (1)
Exponential and Logarthmic funtions (1)Exponential and Logarthmic funtions (1)
Exponential and Logarthmic funtions (1)Ghaffar Khan
 
Quadratic And Polinomial Function
Quadratic And Polinomial FunctionQuadratic And Polinomial Function
Quadratic And Polinomial FunctionGhaffar Khan
 
Quadratic And Polinomial Function
 Quadratic And Polinomial Function Quadratic And Polinomial Function
Quadratic And Polinomial FunctionGhaffar Khan
 
Exponentioal And Logarthmic Functions
 Exponentioal And Logarthmic Functions Exponentioal And Logarthmic Functions
Exponentioal And Logarthmic FunctionsGhaffar Khan
 
Introduction to Computer Networks
 Introduction to Computer Networks Introduction to Computer Networks
Introduction to Computer NetworksGhaffar Khan
 
Computer Graphics Introduction
Computer Graphics IntroductionComputer Graphics Introduction
Computer Graphics IntroductionGhaffar Khan
 

Mehr von Ghaffar Khan (20)

World is beautiful ... ...
World is beautiful ... ...World is beautiful ... ...
World is beautiful ... ...
 
My Presentation On Ajax
My Presentation On AjaxMy Presentation On Ajax
My Presentation On Ajax
 
Sorting
SortingSorting
Sorting
 
How A Computer Works
How A Computer WorksHow A Computer Works
How A Computer Works
 
For Loop
For LoopFor Loop
For Loop
 
Exponential and Logarthmic funtions
Exponential and Logarthmic funtionsExponential and Logarthmic funtions
Exponential and Logarthmic funtions
 
Exponential and Logarthmic funtions (1)
Exponential and Logarthmic funtions (1)Exponential and Logarthmic funtions (1)
Exponential and Logarthmic funtions (1)
 
Functions
FunctionsFunctions
Functions
 
Quadratic And Polinomial Function
Quadratic And Polinomial FunctionQuadratic And Polinomial Function
Quadratic And Polinomial Function
 
Quadratic And Polinomial Function
 Quadratic And Polinomial Function Quadratic And Polinomial Function
Quadratic And Polinomial Function
 
Exponentioal And Logarthmic Functions
 Exponentioal And Logarthmic Functions Exponentioal And Logarthmic Functions
Exponentioal And Logarthmic Functions
 
Internet Protocol
Internet ProtocolInternet Protocol
Internet Protocol
 
Introduction to Computer Networks
 Introduction to Computer Networks Introduction to Computer Networks
Introduction to Computer Networks
 
Network Layer
Network LayerNetwork Layer
Network Layer
 
Input And Output
 Input And Output Input And Output
Input And Output
 
Surfaces
SurfacesSurfaces
Surfaces
 
Vector Tools
Vector ToolsVector Tools
Vector Tools
 
Drawing Tools
Drawing ToolsDrawing Tools
Drawing Tools
 
Drawing Figures
Drawing FiguresDrawing Figures
Drawing Figures
 
Computer Graphics Introduction
Computer Graphics IntroductionComputer Graphics Introduction
Computer Graphics Introduction
 

Kürzlich hochgeladen

How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 

Kürzlich hochgeladen (20)

How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 

Control Structures

  • 1. Control Structures A Lecture By Abdul Ghaffar Khan
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13. The if-else statement: (Example 7.3 Quadratic Equation )
  • 14. The if-else statement: (Example 7.3 Quadratic Equation ) #include <stdio.h> #include <conio.h> #include <math.h> void main(void) { int a, b, c; double d, x1, x2; //clrscr(); printf(&quot;Input a=&quot;); scanf(&quot;%d&quot;,&a); printf(&quot;input b = &quot;); scanf(&quot;%d&quot;,&b ); printf(&quot;input c = &quot;); scanf(&quot;%d&quot;,&c ); d = b*b -4*a*c; if (d<0) { printf(&quot;Roots are not real&quot;); printf(&quot;Enter some other values of a, band c&quot;); } else { x1 = ( -b - sqrt( d )) / (2 * a); x2 = ( -b + sqrt( d )) / (2 * a); printf(&quot;First Root is %.2f&quot;,x1); printf(&quot;Second Root is %.2f&quot;,x2); } getch(); }
  • 15.
  • 16.
  • 17.
  • 19.
  • 20.
  • 21.
  • 22.