5 years ago in C Basic Concepts

In the following program where is the variable a getting defined and where it is getting declared?

#include
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
Loading...
Next Question

Overall Stats

Attempted 116
Correct 43
Incorrect 26
Viewed 47

Answers

Guest
Guest
Deep
Deep - 1 month ago

Deep from Kolkata, India is saying extern int a is declaration, int a = 20 is the definition is correct answer

indhuja indhuja
indhuja indhuja - 4 months ago

indhuja indhuja from Erode, India is saying extern int a is declaration, int a = 20 is the definition is correct answer

R.K YouTube channel
R.K YouTube channel - 8 months ago

R.K YouTube channel from Bhubaneswar, India is saying int a = 20 is definition, a is not defined is correct answer

Rajeswari Raji
Rajeswari Raji - 8 months ago

Rajeswari Raji from Hyderabad, India is saying int a = 20 is definition, a is not defined is correct answer

Yaswanth Jalla
Yaswanth Jalla - 11 months ago

Yaswanth Jalla from Chennai, India is saying extern int a is declaration, int a = 20 is the definition is correct answer

Related Questions

Smallest element of Array Index is called

  • [A] Lower Bond
  • [B] Upper Bond
  • [C] Extraction
  • [D] Rang