SlideShare uma empresa Scribd logo
1 de 9
Baixar para ler offline
Lecture04(Control Structure PART-I)
June 22, 2010
      Today's Outline
         Decision making statements in C
           •   Simple if statement
           •   if_else statement
           •   else_if ladder
           •   nested if_else statement
           •   switch statement
           •   goto statement



 Md. Mahbub Alam         Structured Programming Language   1
                                    (CSE-1121)
Simple if Statement
Format:
                  If ( test condition )
                      statements;


                  scanf( “ %f “ , &marks );
                  if( marks >= 80 )
                     printf( "Yes, the student get A+“ );




Md. Mahbub Alam           Structured Programming Language   2
                                     (CSE-1121)
if_else Statement
Format:
                  if ( test condition )
                       statements;
                  else
                       statements;


                  if( num % 2 == 0 )
                     printf( “Even number“ );
                  else
                     printf( “Odd number” );



Md. Mahbub Alam           Structured Programming Language   3
                                     (CSE-1121)
else_if ladder Statement
Format:
        if(condition 1)                  if( marks > 79 )
              statements;                    printf( " Honours “ );
       else if(condition 2)              else if( marks > 59 )
              statements;                    printf( " First Division “ );
       else if(condition)                else if( marks > 49 )
              statements;                    printf( " Second Division “ );
       .............. ..                 else if( marks > 39 )
       .............. ..                     printf( " Third Division “ );
       else if(condition n)              else
              statements;                    printf(" Fail ");
       else
            default statement;



 Md. Mahbub Alam         Structured Programming Language                      4
                                    (CSE-1121)
nested if_else Statement
Format:
      if ( condition )                if(a>b)
          if ( condition )            {
                                          if(a>c)
                statement1;                 printf("a is the largest:%d",a);
          else                            else
                statement2;                 printf("c is the largest:%d",c) ;
      else                            }
           statement3                 else
                                      {
                                          if(c>b)
                                            printf("c is the largest:%d",c);
                                          else
                                            printf("b is the largest:%d",b) ;
                                      }

 Md. Mahbub Alam       Structured Programming Language                          5
                                  (CSE-1121)
switch Statement
                                            index=marks/10;
Format:                                      switch (index)
                                             {
     Switch ( expression )                     case 10:
                                               case 9:
     {
                                               case 8:
         case constant1:                         printf(" Honours ");
                statements;                      break;
                break;                         case 7:
                                               case 6:
         case constant2:
                                                 printf(“ First Division ");
                statements;                      break;
                break;                         case 5:
          ...............                        printf(“ Second Division ");
                                                 break;
          ...............
                                               case 4:
          default:                               printf(“ Third Division ");
               statements;                       break;
               break;                          default:
      }                                          printf( “ Fail ");
                                                 break;
                                             }
 Md. Mahbub Alam        Structured Programming Language                         6
                                   (CSE-1121)
goto Statement
Format:
       goto label;               main()
        .........                {
        .........                   double x,y;
       label:                       read:
         statements;                scanf("%lf",&x);
                                    if(x<0)
       label:
                                      goto read;
        statements;
                                    y=sqrt(x);
         .........
                                    printf("%lf",y);
         .........
                                 }
       goto label;


 Md. Mahbub Alam        Structured Programming Language   7
                                   (CSE-1121)
Any Question?




Md. Mahbub Alam   Structured Programming Language   8
                             (CSE-1121)
Thank You All




Md. Mahbub Alam     Structured Programming Language   9
                               (CSE-1121)

Mais conteúdo relacionado

Mais procurados

Decision making statements in C
Decision making statements in CDecision making statements in C
Decision making statements in CRabin BK
 
Final project powerpoint template (fndprg) (1)
Final project powerpoint template (fndprg) (1)Final project powerpoint template (fndprg) (1)
Final project powerpoint template (fndprg) (1)heoff
 
Paradigmas de Linguagens de Programacao - Aula #5
Paradigmas de Linguagens de Programacao - Aula #5Paradigmas de Linguagens de Programacao - Aula #5
Paradigmas de Linguagens de Programacao - Aula #5Ismar Silveira
 
C Prog. - Decision & Loop Controls
C Prog. - Decision & Loop ControlsC Prog. - Decision & Loop Controls
C Prog. - Decision & Loop Controlsvinay arora
 
Joji ilagan career center foundation6final
Joji ilagan career center foundation6finalJoji ilagan career center foundation6final
Joji ilagan career center foundation6finalbluejayjunior
 
Flow control instructions
Flow control instructionsFlow control instructions
Flow control instructionsProdip Ghosh
 
Control Structure in C
Control Structure in CControl Structure in C
Control Structure in CNeel Shah
 
C Control Statements.docx
C Control Statements.docxC Control Statements.docx
C Control Statements.docxJavvajiVenkat
 
Cprogrammingprogramcontrols
CprogrammingprogramcontrolsCprogrammingprogramcontrols
Cprogrammingprogramcontrolsteach4uin
 
Introduction to Basic C programming 02
Introduction to Basic C programming 02Introduction to Basic C programming 02
Introduction to Basic C programming 02Wingston
 
Flow of control C ++ By TANUJ
Flow of control C ++ By TANUJFlow of control C ++ By TANUJ
Flow of control C ++ By TANUJTANUJ ⠀
 
Control Flow Statements
Control Flow Statements Control Flow Statements
Control Flow Statements Tarun Sharma
 

Mais procurados (19)

Decision making statements in C
Decision making statements in CDecision making statements in C
Decision making statements in C
 
4. loop
4. loop4. loop
4. loop
 
Final project powerpoint template (fndprg) (1)
Final project powerpoint template (fndprg) (1)Final project powerpoint template (fndprg) (1)
Final project powerpoint template (fndprg) (1)
 
Paradigmas de Linguagens de Programacao - Aula #5
Paradigmas de Linguagens de Programacao - Aula #5Paradigmas de Linguagens de Programacao - Aula #5
Paradigmas de Linguagens de Programacao - Aula #5
 
C Prog. - Decision & Loop Controls
C Prog. - Decision & Loop ControlsC Prog. - Decision & Loop Controls
C Prog. - Decision & Loop Controls
 
Joji ilagan career center foundation6final
Joji ilagan career center foundation6finalJoji ilagan career center foundation6final
Joji ilagan career center foundation6final
 
Flow control instructions
Flow control instructionsFlow control instructions
Flow control instructions
 
C operators
C operatorsC operators
C operators
 
Control Structure in C
Control Structure in CControl Structure in C
Control Structure in C
 
C Control Statements.docx
C Control Statements.docxC Control Statements.docx
C Control Statements.docx
 
Cprogrammingprogramcontrols
CprogrammingprogramcontrolsCprogrammingprogramcontrols
Cprogrammingprogramcontrols
 
Chapter 3
Chapter 3Chapter 3
Chapter 3
 
C++ STATEMENTS
C++ STATEMENTS C++ STATEMENTS
C++ STATEMENTS
 
Switch statement mcq
Switch statement  mcqSwitch statement  mcq
Switch statement mcq
 
Introduction to Basic C programming 02
Introduction to Basic C programming 02Introduction to Basic C programming 02
Introduction to Basic C programming 02
 
Control statement in c
Control statement in cControl statement in c
Control statement in c
 
Flow of control C ++ By TANUJ
Flow of control C ++ By TANUJFlow of control C ++ By TANUJ
Flow of control C ++ By TANUJ
 
Ch3 repetition
Ch3 repetitionCh3 repetition
Ch3 repetition
 
Control Flow Statements
Control Flow Statements Control Flow Statements
Control Flow Statements
 

Semelhante a Lecture04(control structure part i)

CONTROLSTRUCTURES.ppt
CONTROLSTRUCTURES.pptCONTROLSTRUCTURES.ppt
CONTROLSTRUCTURES.pptSanjjaayyy
 
computer programming Control Statements.pptx
computer programming Control Statements.pptxcomputer programming Control Statements.pptx
computer programming Control Statements.pptxeaglesniper008
 
LET US C (5th EDITION) CHAPTER 4 ANSWERS
LET US C (5th EDITION) CHAPTER 4 ANSWERSLET US C (5th EDITION) CHAPTER 4 ANSWERS
LET US C (5th EDITION) CHAPTER 4 ANSWERSKavyaSharma65
 
Fundamentals of programming)
Fundamentals of programming)Fundamentals of programming)
Fundamentals of programming)jakejakejake2
 
Conditional statements
Conditional statementsConditional statements
Conditional statementsNabishaAK
 
2013-06-15 - Software Craftsmanship mit JavaScript
2013-06-15 - Software Craftsmanship mit JavaScript2013-06-15 - Software Craftsmanship mit JavaScript
2013-06-15 - Software Craftsmanship mit JavaScriptJohannes Hoppe
 
2013-06-24 - Software Craftsmanship with JavaScript
2013-06-24 - Software Craftsmanship with JavaScript2013-06-24 - Software Craftsmanship with JavaScript
2013-06-24 - Software Craftsmanship with JavaScriptJohannes Hoppe
 
Virtual Separation of Concerns (2011 Update)
Virtual Separation of Concerns (2011 Update)Virtual Separation of Concerns (2011 Update)
Virtual Separation of Concerns (2011 Update)chk49
 
control stucture in c language
control stucture in c language control stucture in c language
control stucture in c language abdulahi45
 
Reversing & Malware Analysis Training Part 6 - Practical Reversing (I)
Reversing & Malware Analysis Training Part 6 -  Practical Reversing (I)Reversing & Malware Analysis Training Part 6 -  Practical Reversing (I)
Reversing & Malware Analysis Training Part 6 - Practical Reversing (I)securityxploded
 

Semelhante a Lecture04(control structure part i) (20)

L3 control
L3 controlL3 control
L3 control
 
Lecture05(control structure part ii)
Lecture05(control structure part ii)Lecture05(control structure part ii)
Lecture05(control structure part ii)
 
Session 3
Session 3Session 3
Session 3
 
Control Statement programming
Control Statement programmingControl Statement programming
Control Statement programming
 
CONTROLSTRUCTURES.ppt
CONTROLSTRUCTURES.pptCONTROLSTRUCTURES.ppt
CONTROLSTRUCTURES.ppt
 
computer programming Control Statements.pptx
computer programming Control Statements.pptxcomputer programming Control Statements.pptx
computer programming Control Statements.pptx
 
LET US C (5th EDITION) CHAPTER 4 ANSWERS
LET US C (5th EDITION) CHAPTER 4 ANSWERSLET US C (5th EDITION) CHAPTER 4 ANSWERS
LET US C (5th EDITION) CHAPTER 4 ANSWERS
 
Fundamentals of programming)
Fundamentals of programming)Fundamentals of programming)
Fundamentals of programming)
 
Conditional statements
Conditional statementsConditional statements
Conditional statements
 
2013-06-15 - Software Craftsmanship mit JavaScript
2013-06-15 - Software Craftsmanship mit JavaScript2013-06-15 - Software Craftsmanship mit JavaScript
2013-06-15 - Software Craftsmanship mit JavaScript
 
2013-06-24 - Software Craftsmanship with JavaScript
2013-06-24 - Software Craftsmanship with JavaScript2013-06-24 - Software Craftsmanship with JavaScript
2013-06-24 - Software Craftsmanship with JavaScript
 
Perl Intro 4 Debugger
Perl Intro 4 DebuggerPerl Intro 4 Debugger
Perl Intro 4 Debugger
 
Decision Making and Branching
Decision Making and BranchingDecision Making and Branching
Decision Making and Branching
 
Virtual Separation of Concerns (2011 Update)
Virtual Separation of Concerns (2011 Update)Virtual Separation of Concerns (2011 Update)
Virtual Separation of Concerns (2011 Update)
 
control stucture in c language
control stucture in c language control stucture in c language
control stucture in c language
 
Elements of programming
Elements of programmingElements of programming
Elements of programming
 
Reversing & Malware Analysis Training Part 6 - Practical Reversing (I)
Reversing & Malware Analysis Training Part 6 -  Practical Reversing (I)Reversing & Malware Analysis Training Part 6 -  Practical Reversing (I)
Reversing & Malware Analysis Training Part 6 - Practical Reversing (I)
 
C notes.pdf
C notes.pdfC notes.pdf
C notes.pdf
 
What is c
What is cWhat is c
What is c
 
Final Exam in FNDPRG
Final Exam in FNDPRGFinal Exam in FNDPRG
Final Exam in FNDPRG
 

Último

DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersSabitha Banu
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...JhezDiaz1
 
Hierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementHierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementmkooblal
 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfUjwalaBharambe
 
Quarter 4 Peace-education.pptx Catch Up Friday
Quarter 4 Peace-education.pptx Catch Up FridayQuarter 4 Peace-education.pptx Catch Up Friday
Quarter 4 Peace-education.pptx Catch Up FridayMakMakNepo
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Mark Reed
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTiammrhaywood
 
Grade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptxGrade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptxChelloAnnAsuncion2
 
ROOT CAUSE ANALYSIS PowerPoint Presentation
ROOT CAUSE ANALYSIS PowerPoint PresentationROOT CAUSE ANALYSIS PowerPoint Presentation
ROOT CAUSE ANALYSIS PowerPoint PresentationAadityaSharma884161
 
Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Celine George
 
AmericanHighSchoolsprezentacijaoskolama.
AmericanHighSchoolsprezentacijaoskolama.AmericanHighSchoolsprezentacijaoskolama.
AmericanHighSchoolsprezentacijaoskolama.arsicmarija21
 
Gas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxGas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxDr.Ibrahim Hassaan
 
Judging the Relevance and worth of ideas part 2.pptx
Judging the Relevance  and worth of ideas part 2.pptxJudging the Relevance  and worth of ideas part 2.pptx
Judging the Relevance and worth of ideas part 2.pptxSherlyMaeNeri
 
Planning a health career 4th Quarter.pptx
Planning a health career 4th Quarter.pptxPlanning a health career 4th Quarter.pptx
Planning a health career 4th Quarter.pptxLigayaBacuel1
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Celine George
 
ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfSpandanaRallapalli
 

Último (20)

DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginners
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
 
Hierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementHierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of management
 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
 
Quarter 4 Peace-education.pptx Catch Up Friday
Quarter 4 Peace-education.pptx Catch Up FridayQuarter 4 Peace-education.pptx Catch Up Friday
Quarter 4 Peace-education.pptx Catch Up Friday
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
 
Rapple "Scholarly Communications and the Sustainable Development Goals"
Rapple "Scholarly Communications and the Sustainable Development Goals"Rapple "Scholarly Communications and the Sustainable Development Goals"
Rapple "Scholarly Communications and the Sustainable Development Goals"
 
Grade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptxGrade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptx
 
ROOT CAUSE ANALYSIS PowerPoint Presentation
ROOT CAUSE ANALYSIS PowerPoint PresentationROOT CAUSE ANALYSIS PowerPoint Presentation
ROOT CAUSE ANALYSIS PowerPoint Presentation
 
Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17
 
AmericanHighSchoolsprezentacijaoskolama.
AmericanHighSchoolsprezentacijaoskolama.AmericanHighSchoolsprezentacijaoskolama.
AmericanHighSchoolsprezentacijaoskolama.
 
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
Gas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxGas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptx
 
Judging the Relevance and worth of ideas part 2.pptx
Judging the Relevance  and worth of ideas part 2.pptxJudging the Relevance  and worth of ideas part 2.pptx
Judging the Relevance and worth of ideas part 2.pptx
 
Planning a health career 4th Quarter.pptx
Planning a health career 4th Quarter.pptxPlanning a health career 4th Quarter.pptx
Planning a health career 4th Quarter.pptx
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17
 
ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdf
 
9953330565 Low Rate Call Girls In Rohini Delhi NCR
9953330565 Low Rate Call Girls In Rohini  Delhi NCR9953330565 Low Rate Call Girls In Rohini  Delhi NCR
9953330565 Low Rate Call Girls In Rohini Delhi NCR
 

Lecture04(control structure part i)

  • 1. Lecture04(Control Structure PART-I) June 22, 2010 Today's Outline Decision making statements in C • Simple if statement • if_else statement • else_if ladder • nested if_else statement • switch statement • goto statement Md. Mahbub Alam Structured Programming Language 1 (CSE-1121)
  • 2. Simple if Statement Format: If ( test condition ) statements; scanf( “ %f “ , &marks ); if( marks >= 80 ) printf( "Yes, the student get A+“ ); Md. Mahbub Alam Structured Programming Language 2 (CSE-1121)
  • 3. if_else Statement Format: if ( test condition ) statements; else statements; if( num % 2 == 0 ) printf( “Even number“ ); else printf( “Odd number” ); Md. Mahbub Alam Structured Programming Language 3 (CSE-1121)
  • 4. else_if ladder Statement Format: if(condition 1) if( marks > 79 ) statements; printf( " Honours “ ); else if(condition 2) else if( marks > 59 ) statements; printf( " First Division “ ); else if(condition) else if( marks > 49 ) statements; printf( " Second Division “ ); .............. .. else if( marks > 39 ) .............. .. printf( " Third Division “ ); else if(condition n) else statements; printf(" Fail "); else default statement; Md. Mahbub Alam Structured Programming Language 4 (CSE-1121)
  • 5. nested if_else Statement Format: if ( condition ) if(a>b) if ( condition ) { if(a>c) statement1; printf("a is the largest:%d",a); else else statement2; printf("c is the largest:%d",c) ; else } statement3 else { if(c>b) printf("c is the largest:%d",c); else printf("b is the largest:%d",b) ; } Md. Mahbub Alam Structured Programming Language 5 (CSE-1121)
  • 6. switch Statement index=marks/10; Format: switch (index) { Switch ( expression ) case 10: case 9: { case 8: case constant1: printf(" Honours "); statements; break; break; case 7: case 6: case constant2: printf(“ First Division "); statements; break; break; case 5: ............... printf(“ Second Division "); break; ............... case 4: default: printf(“ Third Division "); statements; break; break; default: } printf( “ Fail "); break; } Md. Mahbub Alam Structured Programming Language 6 (CSE-1121)
  • 7. goto Statement Format: goto label; main() ......... { ......... double x,y; label: read: statements; scanf("%lf",&x); if(x<0) label: goto read; statements; y=sqrt(x); ......... printf("%lf",y); ......... } goto label; Md. Mahbub Alam Structured Programming Language 7 (CSE-1121)
  • 8. Any Question? Md. Mahbub Alam Structured Programming Language 8 (CSE-1121)
  • 9. Thank You All Md. Mahbub Alam Structured Programming Language 9 (CSE-1121)