MCQ2 1 11
MCQ2 1 11
Ans :Exponential
Multiply or Divide
Add or Substract
2. Recently Rohit joined as COBOL developer in your team and started working on COBOL programs.
He has to comment few lines of his COBOL program Which character you suggest tohim for
commenting the few COBOL statements?
Ans : *
4. Which type of condition will help you to check whether the variable has numeric data or not?
Ans : CLASS CONDITION
9. 01 WS-SAL PIC S9(7)V9(2) COMP-3 How many bytes WS-SAL occupies internally? Choosemost
appropriate option.
Ans : 5
10. COMPUTE X=Y is equivalent to which of the following statement? Choose most appropriate
option
Ans : MOVE Y TO X
12. Which of the following is true with respect to GOTO and PERFORM?
Ans : GOTO transfers the control to another para permanently whereas PERFORM transfers
control and eventually returns back.
13. John has to accept two numbers from user.perform addition and then display the result.Help john
from where he can start writing these statements in cobol program
Ans : 12 to 72 columns
23.What will be the output of following EVALUATE verb?01 WS-MARK PIC 9(3) VALUE 90.
88 PASS VALUES ARE 60 THRU 100.
88 FAIL VALUES ARE 00 THRU 059.EVALUATE TRUE
WHEN PASS DISPLAY ‘PASSED’ WHEN FAILDISPLAY ‘FAILED’
WHEN OTHER
DISPLAY ‘EITHER PASSED OR FAILED’
END-EVALUATE. Choose most appropriate option.
ANS : OUTPUT IN SPOOL: PASSED
Ans : Environment Division is optional to code Identification Division is Mandatory to code inevery
cobol program.
26. Consider the below code. Assume there are no syntax error01
WS-VALUE PIC 9(3)
88 DATA1 VALUES ARE 1 THRU 9
88 DATA2 VALUES ARE 2.5
What will be the output of below condition
MOVE 2 TO WS-VALUE IF DATA1 AND DATA2 THENDISPLAY
‘FIRST’
ELSE
IF DATA1 THEN DISLAY
‘SECOND’ELSE
DISPLAY ‘THIRD’END-IF
END-IF CHOOSE MOST APPROPRIATE OPTION
ANS: FIRST
27. SNIPPET
01 WS-CNO PIC 9(3)
01 WS-CNAME PIC X(20)
PROCEDURE DIVISION IF WS-
CNO = ‘ ‘
IF WS-CNAME= ‘ ‘
DISPLAY ‘CNO AND CNAME FIELDS ARE BLANK’ELSE
DISPLAY ‘CNAME IS ONLY BLANK’END-IF
ELSE
DISPLAY ‘CNO IS BLANK’ END-IFSTOP RUN
32. Consider the below code and find the output. Assume there are no syntax errors. Data division
Working-storage section
01 ws-num1 pic 9(2) value 01
01 ws-result pic 9(2) value 0
Procedure division A000-main.Add 1
to ws-num1
Perform B000-process 5 times
Compute ws-result = ws-num1+5
Display “result is:”ws-result
Stop run.
B000-process.
Add 1 to ws-num1
ANS: Result is 12
ANS: 2times
35. 01 num1 pic 99 value 50.01 num2 pic 99 value 30.01 res pic 99 value 00.
Compute RES = NUM2 – NUM1.
What is the value of RES after running COMPUTE statement?
ANS: 20
36. 01 NUM1 PIC 9(02) value 20. 01 NUM2 PIC 9(02) value 21.
What will be result of the following operation COMPUTE NUM1 = NUM1 * NUM2 + NUM1.
37. Consider the below code and find the output assume there are no syntax errors. Data division.Working-
storage section.
01 ws-num1 pic 9(2) value 99.
01 ws-num2 pic 9(2) value 0.
01 ws- result pic 9(2) value 0.Procedure division.
Move 2 to ws-num2
Compute ws-result=ws-num1 + ws-num2On size error display ‘error’ End-compute.
Display ws-num2.
Display ws-result. Stop run. 11.
WHAT is the output of following snippet
Ans : ERROR
02
00
39. what is the content of A after execution of the following COBOL code?WORKING-STORAGE SECTION
01 A PIC ZZ9(2) PROCEDURE DIVISION MOVE 10 TO A DISPLAY STOP RUN
Ans : bb10
Ans : WS-NUM1
42. What is the outcome of the below code?01 WS-A PIC 9999
01 WS-B PIC 999 PROCEDURE DIVISION
MOVE 4567 TO WS-A MOVE WS-A TO WS-BDISPLAY WS-B
Ans : 567.
43. WS-SAL PIC S9(7)V9(2) COMP-3. How many bites WS-SAL occupies internally? Choosemost appropriate
Ans : 5
44. Consider the below variable. 01 WS-DATA PIC +9(5). What will be displayed by WS-DATA, if
-189 is moved to it? Note: ‘b’ in the option represents blank space
Ans : -00189
45. Consider the below variable 01 WS-DATA PIC $Z(2)99. What will be displayed by WS-DATA.If 18.99 is
moved to it? Choose most appropriate option?
47. Consider the following cobol code snippet A=3,B=2,C=10,D=501 WS-RESULT PIC9(01)
COMPUTE WS-RESULT = (A*B)+C/D What is the value of WS-RESULT?
Ans : 3
8
Ans : 03 to 49
49. In the below code, find out which variable declaration is invalid?WORKING-STORAGESECTION
04 WS-B PIC 9
77 WS-A PIC X(3)
77 WS-C PIC AAA
01 WS-D PIC 9(1) Choose most appropriate
Ans : WS-B
50. Consider the following partial code snippet01 WS-COUNT PIC 9(1) VALUE 5 PERFORM UNTILWS-COUNT=0
DISPLAY 1
END-PERFORM
SUBTRACT 1 FROM WS-COUNT.
How many times the statement “DISPLAY 1° will be executed? Note. Assume there Is nosyntactical error
in code Choosemost appropriate
Ans : 4
51. What is the size of WS-A variable in bytes? 01 WS-A PIC S9(6) COMP Choose most appropriate
Ans : 4
52. Consider the following partial cobol code: 01 V1 PIC 9(1) VALUE 3 88 COND-1 what willbeoutput of above
code snippet? Choose most appropriate
Ans : OTHER
54. . Consider the below COBOL code snippet. What is the output generated on execution? Assumethere are
no syntax errors.
DATA DIVISION. WORKING-STORAGE SECTION.01 COUNTER PIC9(2).
PROCEDURE DIVISION.
MAIN-PARA INITIALIZE COUNTER.
PERFORM A000-PARA UNTIL. COUNTER > 10.A000-PARA.
DISPLAY ‘WELCOME TO COBOL’ ADD 3 TO COUNTER.
55. What is the content of A after execution of the following COBOL code?
WORKING-STORAGESECTION 01 A PIC ZZ9(2).
PROCEDURE DIVISION. MOVE 10 TO A DISPLAY A STOP RUN
Note: b in options indicates blank spaces Choose most appropriate option
Ans : 10
56. How many times PARA 1 gets executed?
01 WS-COUNT PIC 9(1) VALUE 3.PROCEDURE DIVISION.
MOVE 4 TO WS-COUNT
PERFORM PARA1 VARYING WS-COUNT FROM 1 BY 1 UNTIL WS-COUNT=4.STOP RUN PARA1.
DISPLAY INPUT DATA.
Ans : 3
57. Consider the below variable 001 WS-DATA PIC +9(5). what will be displayed by WS-DATA, if123 iS moved
to it? Note: ‘b’ in the option represents blank Space Choose most appropriate option.
Ans : +00123
58. Joe is declaring a dataname of type binary word to store length of record.Choose the correctdatabytes and
usage clause for declaring half word binary.
Ans.S9(4) COMP
59. Predict the output for the below code? Code snippet
PROCEDURE DIVISION
PERFORM A00-PARA THRU A00-PARA-EXIT.
STOP RUN.
A00-PARA
DISPLAY HEADER STARTING'.
A01-PARA
DISPLAY 'DATA'
A00-PARA-EXIT.
DISPLAY ‘HEADER ENDING’.
62. What is the output of Following program? IDENTIFICATION DIVISION PROGRAM ID HELLO DATADIVISION
WORKING STORAGE SECTION 01 WS-NUMA PIC 9(2) VALUE 10 01 WS-NUMB PIC 9(2) VALUE 10 01 WS-
NUMC PIC 9(2) VALUE 10 01 WS-NUMD PIC 9(2) VALUE 100 01 WS-NUME PIC 9(2) VALUE 10 PROCEDURE
DIVISION SUBTRACT WS-NAMA WS-NUMB WS-NUMC FROM WS- NUMD GIVING WS-NUME DISPLAY WS-
Name STOP RUN
Ans : 70
63. Which cobol verb is usedto move the data from one group data name to another
Ans : > MOVE corresponding
Ans : A B
66. How many forms the DISPLAY-PARA will be excuted in the below snippet?
PERFOEM DISPLAY-PARA VARYING X FROM 0 BY 1 UNTIL X=10.
Note;Pic clause of X is 99
Ans : 1
Ans : bb13.60
**34
Ans : 543
72. Which among the following is a valid elementary variable declaration in the Working Storage section of
COBOL's Data Division? (Choose two correct options)
Ans.: 77 VARIABLE1 PIC 9(5) VALUE 00123 01 VARIABLE1 PIC 9(5) VALUE 123
VARIABLE1 PIC 9(5) VALUE 12
Ans : 77 VARIABLE1 PIC 9(5) VALUE 00123 01 VARIABLE1 PIC 9(5) VALUE 123
75. Which among the following is a valid group variable declaration in the Working Storage sectionof COBOL's
Data Division? (Choose most appropriate option)
Ans : 01 VARIABLE1.
78. Which of the following statements are true wit respect to COBOL program structure?Chooseoptions.
Ans : Environment Division is optional to code
Identification Division is Mandatory to code in every cobol program