Tuesday, June 2, 2020

Basic elements of part 3:


we discussed about statement in previous chapter ,so we will continue the various part of statement in this chapter.


various types of statement:


1)labeled statement :

labeled statement is used for set the location in a program  or it is used to transfer the control of the program . three types of labeled statement exist in c language. generally we are using (:) colon in the labeled statement.
1)Goto statement 
2)switch case statement
3)switch default statement

Goto statement: 

goto statement used  for the transfer the control in the program . it is rarely used because it less readable it makes programs complex and debugging is hard in this statement.  goto statement is divided into two parts .
1)forward jump
2)backward jump

1) syntax and example of forward jump:
                                  syntax:
                                              goto label name;
                                              statement
                                              ______________
                                              ______________
                                              ______________
                                              label name :
                                              statement
                      example:                                                                                                                                                  
    input:

 output  :                                                                                                                                     
        
                       
                                                                           


in this goto  statement we can see that, goto statement jumps two lines and print third lines. so we clearly understand that goto statement is used for jumping.

All others statement,are in the further chapters,so we know about the all statements in further chapter briefly.





 

Labels:

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home