program for if we have to write a program to


PROGRAM FOR IF :

 We have to write a program to check whether the given number is ODD or EVEN.

Identification division.

Program- id. Ifst.

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"

       Go to end-para.

            Display(10 5) " ODD NUMBER"

End-para.

               Stop run.

Request for Solution File

Ask an Expert for Answer!!
COBOL Programming: program for if we have to write a program to
Reference No:- TGS0174604

Expected delivery within 24 Hours