Program for if -else, COBOL Programming

Assignment Help:

PROGRAM FOR IF -ELSE:

We have to write a program to check whether the given number is ODD or EVEN. You can use IF..ELSE.

Identification division.

Program- id. IfElse.

Environment division.

Data division.

Working-storage section.

01 n pic 9(3) value 0.

01 q pic 9(3) value 0.

01 r pic 9(3) value 0.

Procedure division.

Para-1.

  Display(1 1) erase.

  Display( 3 5) " Enter a Number :".

  Accept n.

  Divide n by 2 giving q remainder r.

            If  (r = 0) 

                 Display(10 5) " EVEN NUMBER"

            else      

                 Display(10 5) " ODD NUMBER".

             Stop run.


Related Discussions:- Program for if -else

Program for move corresponding, PROGRAM FOR MOVE CORRESPONDING: We hav...

PROGRAM FOR MOVE CORRESPONDING: We have to write a simple program to demonstrate Move Corresponding. identification division.   program- id.   environment division.

Case study, cobol program for generate a eb bill

cobol program for generate a eb bill

Sequential file creation and rewriting, SEQUENTIAL FILE CREATION AND REWRIT...

SEQUENTIAL FILE CREATION AND REWRITING: We have to write a program to create a student file with just two fields: sno i.e. Student Number and same i.e. Student Name. Add a few

Example of if- else statement, Example of If- else statement Illustrat...

Example of If- else statement Illustration:   IF   QUANTITY IS NUMERIC AND QUANTITY IS POSITIVE          MOVE ZERO TO ERROR-CODE. COMPUTE SALES VALUE=QUANTITY*RATE

Program for inventory , PROGRAM FOR INVENTORY  We have to write a progr...

PROGRAM FOR INVENTORY  We have to write a program to update the inventory file. Consider 2 files,viz, invfile an tranfile. Invfile has 3 fields pno,name,qty. Tranfile has 3 fil

Condition - cobol programming, CONDITION - COBOL Programming: The cond...

CONDITION - COBOL Programming: The condition is an entity which at one point of time can have only one of the two values - true or false. As we already know that, the IF verb

Accept statement, ACCEPT STATEMENT: The ACCEPT statement is used to re...

ACCEPT STATEMENT: The ACCEPT statement is used to read the low-volume data from the operator's console, several other hardware device or from the operating system. The common

Rules for indexed tables, RULES FOR INDEXED TABLES: The rules of index...

RULES FOR INDEXED TABLES: The rules of indexing a table with an INDEXED phrase are as shown below: (1) If indexing is completed for any one level of a table, then indexing

Rules of move verb, RULES OF MOVE VERB:  The Data movement is managed ...

RULES OF MOVE VERB:  The Data movement is managed by the rules which are as shown below: (a) The contents of the identifier - 1 or the value of the literal - 1 is moved to

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd