Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


Consider the following:

77 W-NUM PIC 9 VALUE 0
------
MOVE 1 TO W-NUM
PERFORM PARA-X UNTIL W-NUM > 9.
------
PARA-X
ADD 1 TO W-NUM

How many times PARA-X is executed ?

Answers were Sorted based on User's Feedback



Consider the following: 77 W-NUM PIC 9 VALUE 0 ------ MOVE 1 TO W-NUM ..

Answer / rahul

as the variable W-NUM is single digit (PIC 9), it will
never be greater than 9. Hence the loop will be infinite.

Is This Answer Correct ?    13 Yes 1 No

Consider the following: 77 W-NUM PIC 9 VALUE 0 ------ MOVE 1 TO W-NUM ..

Answer / thrivikram

it goes into infinite loop.

when w-num =9 , it will become 0

Is This Answer Correct ?    10 Yes 1 No

Consider the following: 77 W-NUM PIC 9 VALUE 0 ------ MOVE 1 TO W-NUM ..

Answer / hemanth reddy

Sorry i thought that it is < 9 .
If it is less than 9 it is correct.
If it is > 9 then it goes to infinite loop

Is This Answer Correct ?    8 Yes 0 No

Consider the following: 77 W-NUM PIC 9 VALUE 0 ------ MOVE 1 TO W-NUM ..

Answer / ram.g

sorry for my wrong ans..

it will be in the infinite loop...

should use different ws variables..

Is This Answer Correct ?    4 Yes 1 No

Consider the following: 77 W-NUM PIC 9 VALUE 0 ------ MOVE 1 TO W-NUM ..

Answer / mr.perfect

9 times.
Initially, W-Num value will be 1.
1>9, so para will be executed. - 1 time
2>9, so para will be executed. - 2 times
3>9, so para will be executed. - 3 times
4>9, so para will be executed. - 4 times
5>9, so para will be executed. - 5 times
6>9, so para will be executed. - 6 times
7>9, so para will be executed. - 7 times
8>9, so para will be executed. - 8 times
9>9, so para will be executed. - 9 times
10>9, this will go to 0 because , the PIC at WOrking
storage section is 9. so that 10 becomes 0
W-NNum = 0 . THe loop again start from 0> 9
this will execute Infinite loop.

Is This Answer Correct ?    3 Yes 1 No

Consider the following: 77 W-NUM PIC 9 VALUE 0 ------ MOVE 1 TO W-NUM ..

Answer / guest

it will go in a infinite loop. But simply because
when W-NUM is 9, after "ADD 1 TO W-NUM", W_NUM would again
become 0.

Is This Answer Correct ?    0 Yes 0 No

Consider the following: 77 W-NUM PIC 9 VALUE 0 ------ MOVE 1 TO W-NUM ..

Answer / avinanda mukherjee

Thrivikram is absulately correct....

Avinanda Mukherjee

Is This Answer Correct ?    2 Yes 3 No

Consider the following: 77 W-NUM PIC 9 VALUE 0 ------ MOVE 1 TO W-NUM ..

Answer / gaurav

Rahul's answer is correct.

Please note that the W-NUM is defined as PIC 9, hence it
can contain only a single digit numberic number i.e from
number 0 to number 9. Thus when the PARA-X is executed 9
times when W-NUM contains 9. It will not be able to add
further 1 to W-NUM, thus it will go in a infinite loop.

Hope this clear things.

Is This Answer Correct ?    0 Yes 1 No

Consider the following: 77 W-NUM PIC 9 VALUE 0 ------ MOVE 1 TO W-NUM ..

Answer / vel

9

Is This Answer Correct ?    5 Yes 7 No

Consider the following: 77 W-NUM PIC 9 VALUE 0 ------ MOVE 1 TO W-NUM ..

Answer / hemanth reddy

It will execute 8 times.
Because Initially w_Num is 1 By checking 1 > 9 it will
execute the para-x and adding 1 to W-NUM

Is This Answer Correct ?    2 Yes 4 No

Post New Answer

More COBOL Interview Questions

why we are using set in searchall?

4 Answers   IBM,


In a program, variables are used but no DB2 involved in it. Can you call it as host variables??

4 Answers   EDS,


study the following code 01 A1 05 B PIC 99 05 C PIC X(4) 01 A2 05 B PIC 99V99 05 C PIC A(4) pick out the valid statement from the following a.A1 and A2 can not have sub-ordinates b.A1 and A2 can have the same sub-ordinates but must have same PIC clause c.there is nothing wrong d.A1 and A2 can have same sub-ordinates provided they are not at 01 level

4 Answers   TCS,


Differentiate cobol and cobol-ii. (Most of our programs are written in cobolii, so, it is good to know, how, this is different from cobol)?

0 Answers  


Can we use goto statement in inline_perform ?

5 Answers   IBM,


What is the different between index and subscript?

3 Answers  


What is the mode in which you will OPEN a file for writing?

4 Answers  


What are the divisions in a cobol program?

1 Answers  


diffrence between renames and redifnes with examples

3 Answers   IBM,


consider the following progrm statements MOVE 0 TO SW.NO.OF.REC PERFORM PRI-OUT UNTIL SW=1 DISPALY NO.OF.REC STOP RUN PRE-OUT READ IN-FILE AT END MOVE 1 TO SW WRITE OUO-REC FROM IN-REC ADD 1 TO NO.OF REC if the IN-FILE contains 1000 records what value will be displayedafter the PERFORM is over?assume that N0.OF.REC has PIC 9(4) a.1000 b.1001 c.1 d.none of the above since there is a syntex error

4 Answers   TCS,


) How do you access the migrate the data from production region to development region

1 Answers   IBM,


Will the variable POS in the following code have a value of 2 or not? 01 POS PIC S9(4) COMP VALUE 2. 01 FIRST-NAME PIC X(10) VALUE 'ABC'. 01 LAST-NAME PIC X(10) VALUE 'XYZ'. 01 NAME PIC X(20) VALUE SPACES. STRING FIRST-NAME DELIMITED BY SPACES ' ' DELIMITED BY SIZE LAST-NAME DELIMITED BY SPACES INTO NAME WITH POINTER POS

2 Answers  


Categories