C Programming - Declarations and Initializations - Discussion
Discussion Forum : Declarations and Initializations - General Questions (Q.No. 9)
9.
Identify which of the following are declarations
1 : | extern int x; |
2 : | float square ( float x ) { ... } |
3 : | double pow(double, double); |
Answer: Option
Explanation:
extern int x; - is an external variable declaration.
double pow(double, double); - is a function prototype declaration.
Therefore, 1 and 3 are declarations. 2 is definition.
double pow(double, double); - is a function prototype declaration.
Therefore, 1 and 3 are declarations. 2 is definition.
Discussion:
37 comments Page 3 of 4.
Xyz said:
1 decade ago
float x;
Is this statement a declaration or definition?
It was mentioned as a definition in book.
Is this statement a declaration or definition?
It was mentioned as a definition in book.
Divya said:
1 decade ago
Float x; is a declaration.
Babi said:
1 decade ago
What is the difference between definition and declaration?
Sadhana said:
1 decade ago
Can I have a example program on [double pow(double, double);]?
Shradha said:
1 decade ago
What is extern?
Priyanga said:
10 years ago
Can anyone explain more about float square (float x) {....} clearly?
Lincy Joseph said:
9 years ago
What does the second line mean?
San said:
9 years ago
If pow is the functional means then what about pow?
Is it also expanded as the power of right? Do clearly explain anyone?
Is it also expanded as the power of right? Do clearly explain anyone?
Priyanka garg said:
9 years ago
double pow(double,double);
Is it not the function call?
Is it not the function call?
(1)
Vani said:
8 years ago
Nice explanation @Sundar.
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers