Log In Register

Units


External Variables - Questions and Answers

 

Practice these External Variables under C Programming walk-in interview Questions/ examination questions with best tricks and short cuts with solution. Student (candidate) who want to crack the walk in interview, competitive exams and want to find short cuts and tricks to solve questions on External Variables for following purpose.


– Anyone who is wishing to increase their perfect knowledge of External Variables of C Programming.
– Anyone who is preparing for aptitude test and increase his in depth aptitude knowledge C Programming specifically External Variables.
– Anyone who is preparing for interviews (competitive examinations, govt examinations and bank examinations, off-campus or on campus interviews, walk-in interview and company interviews) having questions on External Variables under C Programming.

– Anyone who is preparing for aptitude test or competitive exam or entrance exam.
– Anyone who is preparing for entrance examinations and other competitive examinations.
– All Experienced, Freshers and Students.

Here is list of Questions and Answers covering all key area of  External Variables topic of C Programming:

 

1.

Which part of the program address space is p stored in the code given below?

  1.     #include <stdio.h>
  2.     int *p;
  3.     int main()
  4.     {
  5.         int i = 0;
  6.         p = &i;
  7.         return 0;
  8.     }

Answer: Option B

Explanation:

2.

Which of the following are an external variable?

  1.     #include <stdio.h>
  2.     int func (int a)
  3.     {
  4.         int b;
  5.         return b;
  6.     }
  7.     int main()
  8.     {
  9.         int c;
  10.         func (c);
  11.     }
  12.     int d;

Answer: Option A

Explanation:

3.

Can variable i be accessed by functions in another source file?

  1.     #include <stdio.h>
  2.     int i;
  3.     int main()
  4.     {
  5.         printf("%d\n", i);
  6.     }

Answer: Option D

Explanation:

4.

What is the output of this C code?

  1.     #include <stdio.h>
  2.     static int x = 5;
  3.     void main()
  4.     {
  5.         x = 9;
  6.         {
  7.             int x = 4;
  8.         }
  9.         printf("%d", x);
  10.     }

Answer: Option D

Explanation:

5.

What is the output of this C code?

  1.     #include <stdio.h>
  2.     int x = 5;
  3.     void main()
  4.     {
  5.         int x = 3;
  6.         printf("%d", x);
  7.         {
  8.             x = 4;
  9.         }
  10.         printf("%d", x);
  11.     }

Answer: Option A

Explanation:

6.

What is the output of this C code?

  1.     #include <stdio.h>
  2.     int *i;
  3.     int main()
  4.     {
  5.         if (i == 0)
  6.             printf("true\n");
  7.         return 0;
  8.     }

Answer: Option C

Explanation:

7.

What is the output of this C code?

  1.     #include <stdio.h>
  2.     double i;
  3.     int main()
  4.     {
  5.        printf("%g\n",i);
  6.        return 0;
  7.     }

Answer: Option D

Explanation:

8.

What will be the output?

  1.     #include <stdio.h>
  2.     double var = 8;
  3.     int main()
  4.     {
  5.         int var = 5;
  6.         printf("%d", var);
  7.     }

Answer: Option D

Explanation:

9.

Functions in C are ALWAYS:

Answer: Option C

Explanation:

10.

What is the output of this C code?

  1.     #include <stdio.h>
  2.     int x;
  3.     void main()
  4.     {
  5.         printf("%d", x);
  6.     }

Answer: Option B

Explanation:

11.

Which part of the program address space is p stored in the code given below?

  1.     #include <stdio.h>
  2.     int *p = NULL;
  3.     int main()
  4.     {
  5.         int i = 0;
  6.         p = &i;
  7.         return 0;
  8.     }

Answer: Option C

Explanation:

12.

Property of external variable to be accessed by any source file is called by C90 standard as

Answer: Option C

Explanation:

13.

What is the output of this C code?

  1.     #include <stdio.h>
  2.     int x = 5;
  3.     void main()
  4.     {
  5.         int x = 3;
  6.         printf("%d", x);
  7.         {
  8.             int x = 4;
  9.         }
  10.         printf("%d", x);
  11.     }

Answer: Option D

Explanation:

14.

Global variables are:

Answer: Option A

Explanation:

15.

What is the output of this C code?

  1.     #include <stdio.h>
  2.     int *i;
  3.     int main()
  4.     {
  5.         if (i == NULL)
  6.             printf("true\n");
  7.         return 0;
  8.     }

Answer: Option D

Explanation: