5 years ago in C Basic Concepts

Suppose a program is divided into three files f1, f2 and f3, and a variable is defined in the file f1 but used in files f2 and f3. In such a case would we need the extern declaration for the variables in the files f2 and f3?

[A] Yes
[B] No
Loading...
Next Question

Overall Stats

Attempted 110
Correct 56
Incorrect 14
Viewed 40

Answers

Guest
Guest
Deep
Deep - 1 month ago

Deep from Kolkata, India is saying Yes is correct answer

indhuja indhuja
indhuja indhuja - 4 months ago

indhuja indhuja from Erode, India is saying Yes is correct answer

Radha Gururaj
Radha Gururaj - 4 months ago

Radha Gururaj is saying No is correct answer

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

R.K YouTube channel from Bhubaneswar, India is saying Yes is correct answer

Rajeswari Raji
Rajeswari Raji - 8 months ago

Rajeswari Raji from Hyderabad, India is saying Yes is correct answer

Related Questions

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

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

Is there any difference between following declarations? 1 : extern int fun(); 2 : int fun();

  • [A] Both are identical
  • [B] No difference, except extern int fun(); is probably in another file
  • [C] int fun(); is overrided with extern int fun();
  • [D] None of these

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

When we mention the prototype of a function?

  • [A] Defining
  • [B] Declaring
  • [C] Prototyping
  • [D] Calling