GeekInterview.com
  I am new, Sign me up!
 
GeekInterview.com  >  Placement Papers  >  TCS  >  COBOL
Go To First  |  Previous Question  |  Next Question 
 COBOL  |  Question 6 of 44    Print  
what if any, is the syntax error in the following piece of code
01 B PIC A(7)
02 C PIC 9(4)
IF(B NUMERIC)
ADD 10 TO C
a.the condition in the if statement is wrong
b.noting is wrong
c.because C is initialised.ADD 10 TO C is wrong
d.both B and C shoud have same size.

  
Total Answers and Comments: 3 Last Update: November 20, 2009   
  
 Sponsored Links

 
 Best Rated Answer
Submitted by: Kiran
 

Ans:- a(the condition in the if statement is wrong)

For the Variable declared as alphabetic the valid test conditions are

 A IS [NOT]ALPHABETIC

 A IS [NOT]ALPHABETIC-LOWER

 A IS [NOT]ALPHABETIC-UPPER

    Where [NOT] is optional...



Above answer was rated as good by the following members:
chandradutt
April 05, 2006 08:26:42   #1  
Kiran        

RE: what if any, is the syntax error in the following ...

Ans:- a(the condition in the if statement is wrong)

For the Variable declared as alphabetic the valid test conditions are

A IS [NOT]ALPHABETIC

A IS [NOT]ALPHABETIC-LOWER

A IS [NOT]ALPHABETIC-UPPER

Where [NOT] is optional...


 
Is this answer useful? Yes | NoAnswer is useful 1   Answer is not useful 0Overall Rating: +1    
June 15, 2006 11:32:40   #2  
sharmilabit Member Since: June 2006   Contribution: 3    

RE: what if any, is the syntax error in the following ...
ANS IS b. nothing is wrong....because it won't give any compilation or run time error. its just that the condition won't be satisfied and 10 will not be added to C and since C has not been assigned any value nothing would be displayed. test it if u have doubt.
 
Is this answer useful? Yes | No
November 20, 2009 05:24:47   #3  
chandradutt Member Since: November 2009   Contribution: 3    

RE: what if any, is the syntax error in the following piece of code 01 B PIC A(7) 02 C PIC 9(4) IF(B NUMERIC) ADD 10 TO C a.the condition in the if statement is wrong b.noting is wrong c.because C is initialised.ADD 10 TO C is wrong d.both B and C
You are correct that it wont give any compilation or run time error but SYNTAX is definetly wrong. so the correct answer should be 'A.the condition in the if statement is wrong'
 
Is this answer useful? Yes | No


 
Go To Top


 Sponsored Links

 
About Us -  Privacy Policy -  Terms and Conditions -  Contact -  Ask Question -  Propose Category -  Site Updates 

Copyright © 2005 - 2009 GeekInterview.com. All Rights Reserved

Page copy protected against web site content infringement by Copyscape