Which of the following about automatic variables within a function is correct ?a.its type must be declared before using the variableb.they are localc.they are not initialised to zerod.they are global.

C
This question is related to TCS Interview

Showing Answers 1 - 5 of 5 Answers

rp

  • Aug 25th, 2005
 

answer C in the sense,A is wrong? 
how could the statement A wrong 
with out declaring the variable how can we use it? 
C is right but A is right too... 
think about B also for a while...

  Was this answer useful?  Yes

Aniruddha

  • Dec 10th, 2005
 

A may/may not be correct-It may be used within a function and defined as global outside of it..Hence,its being used without being defined in the funcion.B May be global/local.Hence Not always true.D Same as aboveC- It is true.If declared static,then its initialized to zero.

satish_kattika

  • Mar 15th, 2006
 

c is correct there is no need to declare avariable as aouto by default it is auto

  Was this answer useful?  Yes

piyush

  • Sep 25th, 2007
 

The answer is option B.
As automatic variables are local only to the scope in which it is declared.

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions