6 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

Create your Digital Resume For FREE on your name's sub domain "yourname.wcard.io". Register Here!


Overall Stats

Attempted 61
Correct 26
Incorrect 11
Viewed 24

Answers

Guest
Guest
Shuvam sinha
Shuvam sinha - 4 years ago

Shuvam sinha from Berhampur, India is saying extern int a is declaration, int a = 20 is the definition is correct answer

Pooja Gupta
Pooja Gupta - 4 years ago

Pooja Gupta from India is saying extern int a is declaration, int a = 20 is the definition is correct answer

Sofia Fadzil
Sofia Fadzil - 4 years ago

Sofia Fadzil from Kuala Lumpur, Malaysia is saying int a = 20 is definition, a is not defined is correct answer

Payal
Payal - 4 years ago

Payal from Patna, India is saying extern int a is declaration, int a = 20 is the definition is correct answer

Bhawna wadhwa
Bhawna wadhwa - 4 years ago

Bhawna wadhwa from India is saying a is declared, a is not defined is correct answer

Related Questions

Is the following statement a declaration or definition? extern int i;

  • [A] Declaration
  • [B] Definition
  • [C] Function
  • [D] Error

C language has been developed by ?

  • [A] . Dennis Ritchie
  • [B] Peter Norton
  • [C] Ken Thompson
  • [D] Martin Richards