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.
Sakshi wadhwa said:
5 years ago
Why float square(float x) is not a declaration? Please explain.
Haritha said:
1 decade ago
float square ( float x ) { ... }
Why it is not a declaration?
Why it is not a declaration?
Sadhana said:
1 decade ago
Can I have a example program on [double pow(double, double);]?
Babi said:
1 decade ago
What is the difference between definition and declaration?
Priyanka garg said:
9 years ago
double pow(double,double);
Is it not the function call?
Is it not the function call?
(1)
Vijay said:
1 decade ago
What is difference between declaration and definition?
Prachi said:
7 years ago
The semicolon is not used in the function definition.
Vivek patel said:
1 decade ago
Thanks to all for a good answers.
Masanta said:
5 years ago
Thank you all for explaining it.
Lincy Joseph said:
9 years ago
What does the second line mean?
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers