C Programming - Declarations and Initializations - Discussion
Discussion Forum : Declarations and Initializations - General Questions (Q.No. 10)
10.
In the following program where is the variable a getting defined and where it is getting declared?
#include<stdio.h>
int main()
{
extern int a;
printf("%d\n", a);
return 0;
}
int a=20;
Answer: Option
Explanation:
- During declaration we tell the datatype of the Variable.
- During definition the value is initialized.
Discussion:
44 comments Page 5 of 5.
Vasudevan said:
1 decade ago
int a=20;(it is a outside of initialization)
how it consider for this program
how it consider for this program
Snehal kadam said:
1 decade ago
In above option is D option correct??
in place of C
in place of C
Snehal kadam said:
1 decade ago
In main, "extern int a" is declaration is ok.
but it is defined in outside;
so ,is the option c is correct???
but it is defined in outside;
so ,is the option c is correct???
Om tripathi said:
1 decade ago
int a=20; is outside the main
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers