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 COBOL entries
05 X PIC 99 VALUE 10.
ADD 40 X TO X.
COMPUTE X = 3 * X - 40.
The result in X is

Answers were Sorted based on User's Feedback



Consider the following COBOL entries 05 X PIC 99 VALUE 10. ADD 40 X TO X. COMPUTE X = 3 * X - ..

Answer / muhammad abdul aleem

I doubt if 05 level number will work or not.
But if it works the here is the answer.

Add 40,x to x means X = 10 + 40 + 10 =60
then
x = 60*3 -40
x=180-40
= 140

Since X = 99 so value will be 40
Therefore, Value of X will be 40...

Is This Answer Correct ?    26 Yes 0 No

Consider the following COBOL entries 05 X PIC 99 VALUE 10. ADD 40 X TO X. COMPUTE X = 3 * X - ..

Answer / rama krishna

Answer is again 10.

Add 40 to x :
x + 40 : 10 + 40 = 50

X = 3*X - 40
3 * x = 50 * 3 = 150, but since x declared as PIC 99, 1
will be truncated from 150. so now the value of x would be
50. so 50 - 40 is again 10.

Is This Answer Correct ?    22 Yes 6 No

Consider the following COBOL entries 05 X PIC 99 VALUE 10. ADD 40 X TO X. COMPUTE X = 3 * X - ..

Answer / varun v

I agree with Ans #4. I also checked the same..Value of X
will be 40...


Please please verify it thouroughly before publishing the
answers...Wrong answers will mislead people..

Is This Answer Correct ?    4 Yes 1 No

Consider the following COBOL entries 05 X PIC 99 VALUE 10. ADD 40 X TO X. COMPUTE X = 3 * X - ..

Answer / neelam

I agree with all of them who have answered 40.
It is a simple statement in cobol that

ADD A B TO C. (Means (A+B)+C moved in C)

Here,
ADD 40 X TO X ()

Value of X is 10
So, ADD 40 10 TO 10 (Gives 40+10+10 = 60)


Now, COMPUTE X = 3 * X - 40
Means X = 3 * 60 - 40 (Gives 180 - 40 = 140 )

Since PIC clause for X is 99, hence 140 can't be store in
variable X.

So answer is : 40

Is This Answer Correct ?    3 Yes 0 No

Consider the following COBOL entries 05 X PIC 99 VALUE 10. ADD 40 X TO X. COMPUTE X = 3 * X - ..

Answer / akhilesh

FRIENDS HAVE ATTENTION

DIRECTLY CODING 05 LEVEL ENTRY WILL SHOW ERROR

Is This Answer Correct ?    2 Yes 1 No

Consider the following COBOL entries 05 X PIC 99 VALUE 10. ADD 40 X TO X. COMPUTE X = 3 * X - ..

Answer / ram g

compiler wont support 05 level direct coding ..assuming
that its a 01 level .. ans is 40.

Is This Answer Correct ?    3 Yes 2 No

Consider the following COBOL entries 05 X PIC 99 VALUE 10. ADD 40 X TO X. COMPUTE X = 3 * X - ..

Answer / kumar l

ADD 40 X to X means : 40+X will add to X and result will
be stored in X - Result is 60
Compute X = 3 * X - 40 means : 3*60-40 = 140.
So X value is 140.

Is This Answer Correct ?    5 Yes 6 No

Consider the following COBOL entries 05 X PIC 99 VALUE 10. ADD 40 X TO X. COMPUTE X = 3 * X - ..

Answer / suputhru

I agree with Rama Krishna ans: 10

05 X PIC 99 VALUE 10.
ADD 40 X TO X. ----------- x=x+40 x=10+40 x=50
COMPUTE X = 3 * X - 40.------x=(3*50)-40 x=150-40 x=110 since x pic 99--


finally x=10

antheeeeeeeee.

Is This Answer Correct ?    1 Yes 2 No

Consider the following COBOL entries 05 X PIC 99 VALUE 10. ADD 40 X TO X. COMPUTE X = 3 * X - ..

Answer / geetanjali

ADD 40 X TO X
***********ADD 40 10 TO X
***********X=X+40+10=60
***********COMPUTE X=3*60-40=120
X=120

Is This Answer Correct ?    0 Yes 1 No

Consider the following COBOL entries 05 X PIC 99 VALUE 10. ADD 40 X TO X. COMPUTE X = 3 * X - ..

Answer / ssampath

110

Is This Answer Correct ?    0 Yes 2 No

Post New Answer

More COBOL Interview Questions

Can you please let me know the centre name of INS certification in Kolkata.

0 Answers  


Difference between array and sub-script ?

0 Answers   HCL,


What is the Purpose of POINTER Phrase in STRING command

3 Answers  


consider two data items 77 W-A PIC 9(3)V99 VALUE 23.75 77 W-B PIC ZZ9V99 VLAUE 123.45 after the statement MOVE W-A TO W-B what will be W-B's value? a.123.75 b.b23.75 (where b indicates space) c.023.75 d.invalid move

5 Answers   TCS,


what is the size of W-REC in the following 01 W-REC 05 A PIC 9(4)V99 05 B READLINES A 10 C PIC XX 10 D PIC S9(4) 05 E OCCURS 7 PIC ZZ.ZZ 05 F OCCURS 5 10 G PIC ZZ.ZZZ99 10 H OCCURS 3 15 J PIC 9(3) 15 K PIC V99

2 Answers   TCS,


What will happen if you code GO BACK instead of STOP RUN in a stand-alone COBOL program i.e. a program which is not calling any other program ?

3 Answers  


I HAVE FOLLOWING DECLARATION. 02. A PIC X(10) VALUE 'XXXXXXXXXX'. 02. B REDEFINES A. 05. C PIC X(3). 05. D PIC X(3). 05. E PIC 9(3). IN MY PROG, I HAVE MOVE 1 TO E. DISPLAY A. WHAT WILL BE DISPLAYED AS A RESULT OF THIS? PLEASE EXPLAIN THE ANSWER. THANKS.

7 Answers   Amdocs,


What do you understand by psb and acb?

0 Answers  


write a program to eliminate duplicate records in a input file and send them to output file.

2 Answers   IBM,


What is report-item in COBOL?

0 Answers   Arigo Infotech,


How to read records which is in sequential file in reverse order ? Exp. 1 2 3 4 5 . i want 5 4 3 2 1?please clear my doubt any one

10 Answers   IBM,


how can we fetch 3 records in cobol pgm any coding pls ?

3 Answers   CGI,


Categories