Logo 
Search:

Cobol Articles

Submit Article
Home » Articles » Cobol » Homework HelpRSS Feeds

Program that describes the functionality of IF-ELSE Clause

Posted By: Bluma Fischer     Category: Cobol     Views: 1441

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-TEST.
       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...50
ENTER NUM2...15
50 IS GREATER THAN 15
  
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.

Bluma Fischer
Bluma 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!