Log In Register

Units


Register Variables - Questions and Answers

 

Practice these Register 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 Register Variables for following purpose.


– Anyone who is wishing to increase their perfect knowledge of Register Variables of C Programming.
– Anyone who is preparing for aptitude test and increase his in depth aptitude knowledge C Programming specifically Register 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 Register 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  Register Variables topic of C Programming:

 

1.

What is the output of this C code?

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

Answer: Option C

Explanation:

2.

Which data type can be stored in register?

Answer: Option D

Explanation:

3.

What is the output of this C code?

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

Answer: Option D

Explanation:

4.

What is the output of this C code?

  1.     #include <stdio.h>
  2.     int main()
  3.     {
  4.         register int i = 10;
  5.         int *p = &i;
  6.         *p = 11;
  7.         printf("%d %d\n", i, *p);
  8.     }

Answer: Option A

Explanation:

5.

What is the output of this C code?

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

Answer: Option A

Explanation:

6.

When compiler accepts the request to use the variable as a register?

Answer: Option D

Explanation:

7.

What is the output of this C code?

  1.     #include <stdio.h>
  2.     void main()
  3.     {
  4.         register int x = 0;
  5.         if (x < 2)
  6.         {
  7.             x++;
  8.             main();
  9.         }
  10.     }

Answer: Option B

Explanation:

8.

What is the output of this C code?

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

Answer: Option A

Explanation:

9.

register keyword mandates compiler to place it in machine register.

Answer: Option C

Explanation:

10.

Which of the following operation is not possible in a register variable?

Answer: Option A

Explanation:

11.

Which among the following is the correct syntax to declare a static variable register?

Answer: Option C

Explanation:

12.

What is the output of this C code?

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

Answer: Option C

Explanation:

13.

What is the output of this C code?

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

Answer: Option A

Explanation:

14.

Which among the following is wrong for “register int a;” ?

Answer: Option D

Explanation:

15.

Register storage class can be specified to global variables

Answer: Option C

Explanation: