Question
#include<stdio.h>
int main()
{
extern int a;
printf("%d\n", a);
return 0;
}
int a=20;
a.
extern int a is declaration, int a = 20 is the definition
b.
int a = 20 is declaration, extern int a is the definition
c.
int a = 20 is definition, a is not defined
d.
a is declared, a is not defined
Posted under C Programming
Engage with the Community - Add Your Comment
Confused About the Answer? Ask for Details Here.
Know the Explanation? Add it Here.
Q. In the following program where is the variable a getting defined and where it is getting declared?
Similar Questions
Discover Related MCQs
Q. When we mention the prototype of a function?
View solution
Q. Which of the declaration is correct?
View solution
Q. Which of the following operations are INCORRECT?
View solution
Q. Which of the following correctly represents a long double constant?
View solution
Q. Which of the following correctly shows the hierarchy of arithmetic operations in C?
View solution
Q. Which of the following is the correct usage of conditional operators used in C?
View solution
Q.
Which of the following are unary operators in C?
1. !
2. sizeof
3. ~
4. &&
View solution
Q. In which order do the following gets evaluated
1. Relational
2. Arithmetic
3. Logical
4. Assignment
View solution
Q. What are the types of linkages?
View solution
Q. Is there any difference between following declarations?
1 :
extern int fun();
2 :
int fun();
View solution
Q. Which of the following is not user defined data type?
1 :
struct book
{
char name[10];
float price;
int pages;
};
2 :
long int l = 2.35;
3 :
enum day {Sun, Mon, Tue, Wed};
View solution
Q. Identify which of the following are declarations
1 :
extern int x;
2 :
float square ( float x ) { ... }
3 :
double pow(double, double);
View solution
Q. Which of the following is correct about err used in the declaration given below?
typedef enum error { warning, test, exception } err;
View solution
Q. Which of the structure is incorrcet?
1 :
struct aa
{
int a;
float b;
};
2 :
struct aa
{
int a;
float b;
struct aa var;
};
3 :
struct aa
{
int a;
float b;
struct aa *var;
};
View solution
Q. Which of the structure is correct?
1 :
struct book
{
char name[10];
float price;
int pages;
};
2 :
struct aa
{
char name[10];
float price;
int pages;
}
3 :
struct aa
{
char name[10];
float price;
int pages;
}
View solution
Q. 1 :
typedef long a;extern int a c;
2 :
typedef long a;extern a int c;
3 :
typedef long a;extern a c;
View solution
Q. Which of the following is the correct order of evaluation for the below expression?z = x + y * z / 4 % 2 - 1
View solution
Q. Which of the following is the correct order if calling functions in the below code?
a = f1(23, 14) * f2(12/4) + f3();
View solution
Q. Which of the following are unary operators in C?
1. !
2. sizeof
3. ~
4. &&
View solution
Q. In which order do the following gets evaluated
1. Relational
2. Arithmetic
3. Logical
4. Assignment
View solution
Suggested Topics
Are you eager to expand your knowledge beyond C Programming? We've curated a selection of related categories that you might find intriguing.
Click on the categories below to discover a wealth of MCQs and enrich your understanding of Computer Science. Happy exploring!