C Programming - Declarations and Initializations - Discussion

Discussion Forum : Declarations and Initializations - General Questions (Q.No. 9)
Identify which of the following are declarations
1 : extern int x;
2 : float square ( float x ) { ... }
3 : double pow(double, double);
1 and 3
Answer: Option
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.
37 comments Page 1 of 4.

Priyanka garg said:   7 years ago
double pow(double,double);

Is it not the function call?

Priyanka said:   10 years ago
Hi Lipsha,

void main()
int num1;

void display(int para1)


In This example:

-> num1 is actual definition or actual parameter.(Parameters used in Function declaration is called actual parameters.).

-> para1 is formal definition or formal parameters.(Parameters used in Function definition is called actual parameters.).

Lipsha said:   10 years ago
What is the difference between actual definition & formal definition?

Xyz said:   10 years ago
float x;

Is this statement a declaration or definition?
It was mentioned as a definition in book.

Divya said:   9 years ago
Float x; is a declaration.

Babi said:   9 years ago
What is the difference between definition and declaration?

Sadhana said:   9 years ago
Can I have a example program on [double pow(double, double);]?

Shradha said:   9 years ago
What is extern?

Priyanga said:   8 years ago
Can anyone explain more about float square (float x) {....} clearly?

Lincy Joseph said:   8 years ago
What does the second line mean?

Post your comments here:

Your comments will be displayed after verification.