Logo 
Search:

Cobol Articles

Submit Article
Home » Articles » Cobol » Homework HelpRSS Feeds

Program to check whether student is pass or fail by taking result from user

Posted By: Nixie Schmidt     Category: Cobol     Views: 7431

Program to check whether student is pass or fail by taking result from user.

Code for Program to check whether student is pass or fail by taking result from user in Cobol

       IDENTIFICATION DIVISION.
         PROGRAM-ID. EVAL1.
       DATA DIVISION.
         01 RES PIC 999.
       PROCEDURE DIVISION.
        DISP.
           DISPLAY "ENTER YOUR RESULT:".
           ACCEPT RES.
           EVALUATE RES
            WHEN 1 THRU 40
               DISPLAY "FAIL"
            WHEN 40 THRU 50
               DISPLAY "PASS"
            WHEN 51 THRU 60
               DISPLAY "SECOND"
            WHEN 61 THRU 70
               DISPLAY "FIRST"
            WHEN 71 THRU 100
               DISPLAY "DISTINCTION"
           STOP RUN.

       ************************ OUTPUT***********************************
           ENTER YOUR RESULT:-40
           FAIL
           ENTER YOUR RESULT:-45
           PASS
           ENTER YOUR RESULT:-55
           SECOND
           ENTER YOUR RESULT:-99
           FIRST
  
Share: 



Nixie Schmidt
Nixie Schmidt author of Program to check whether student is pass or fail by taking result from user is from Frankfurt, Germany.
 
View All Articles

Related Articles and Code:


 
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!