Logo 
Search:

Cobol Articles

Submit Article
Home » Articles » Cobol » Homework HelpRSS Feeds

Program that describes the functionality of IF-ELSE Clause

Posted By: Rae Fischer     Category: Cobol     Views: 2707

Program that describes the functionality of IF-ELSE Clause.

Code for Program that describes the functionality of IF-ELSE Clause in Cobol

       IDENTIFICATION DIVISION.
        PROGRAM-ID. IF-ELSE1.
       DATA DIVISION.
        WORKING-STORAGE SECTION.
         77 NUM1 PIC 99.
         77 NUM2 PIC 99.
       PROCEDURE DIVISION.
        PARA-1.
           DISPLAY "ENTER NUM1..." WITH NO ADVANCING.
           ACCEPT NUM1.
           DISPLAY "ENTER NUM2..." WITH NO ADVANCING.
           ACCEPT NUM2.
           IF NUM1 = NUM2 
               CONTINUE
           ELSE
               IF NUM1 > NUM2
                    DISPLAY NUM1 " IS GREATER THAN " NUM2
               ELSE
                    DISPLAY NUM2 " IS GREATER THAN " NUM1
               END-IF
           END-IF.
           STOP RUN.

#--------------------------------------------------------------------------------#

                OUTPUT

#--------------------------------------------------------------------------------#
ENTER NUM1...34
ENTER NUM2...31
34 IS GREATER THAN 31
  
Share: 


Didn't find what you were looking for? Find more on Program that describes the functionality of IF-ELSE Clause Or get search suggestion and latest updates.

Rae Fischer
Rae Fischer author of Program that describes the functionality of IF-ELSE Clause is from Frankfurt, Germany.
 
View All Articles

 
Please enter your Comment

  • Comment should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].

 
No Comment Found, Be the First to post comment!