Log In Register

Units


Table Lookup - Questions and Answers

 

Practice these Table Lookup 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 Table Lookup for following purpose.


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

 

1.

What is the output of this C code?

  1.     #include <stdio.h>
  2.     void main()
  3.     {
  4.         int lookup[100] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
  5.         printf("%d", lookup[3]);
  6.     }

Answer: Option A

Explanation:

2.

Which function is responsible for recording the name “s” and the replacement text “t” in a     table?

Answer: Option D

Explanation:

3.

Which of the following is true?

Answer: Option C

Explanation:

4.

What is the output of this C code?

  1.     #include <stdio.h>
  2.     struct p
  3.     {
  4.         char *name;
  5.         struct p *next;
  6.     };
  7.     struct p *ptrary[10];
  8.     int main()
  9.     {
  10.         struct p p;
  11.         p.name = "xyz";
  12.         p.next = NULL;
  13.         ptrary[0] = &p;
  14.         printf("%s\n", ptrary[0]->name);
  15.         return 0;
  16.     }

Answer: Option A

Explanation:

5.

What is the output of this C code?

  1.     #include <stdio.h>
  2.     struct p
  3.     {
  4.         char *name;
  5.         struct p *next;
  6.     };
  7.     struct p *ptrary[10];
  8.     int main()
  9.     {
  10.         struct p p, q;
  11.         p.name = "xyz";
  12.         p.next = NULL;
  13.         ptrary[0] = &p;
  14.         strcpy(q.name, p.name);
  15.         ptrary[1] = &q;
  16.         printf("%s\n", ptrary[1]->name);
  17.         return 0;
  18.     }

Answer: Option C

Explanation:

6.

What happens when install(s, t) finds that the name being installed is already present in     table?

Answer: Option C

Explanation:

7.

What is the output of this C code?

  1.     #include <stdio.h>
  2.     struct p
  3.     {
  4.         char *name;
  5.         struct p *next;
  6.     };
  7.     struct p *ptrary[10];
  8.     int main()
  9.     {
  10.         struct p p;
  11.         p->name = "xyz";
  12.         p->next = NULL;
  13.         ptrary[0] = &p;
  14.         printf("%s\n", p->name);
  15.         return 0;
  16.     }

Answer: Option D

Explanation:

8.

What is the output of this C code?

  1.     #include <stdio.h>
  2.     struct student
  3.     {
  4.         char a[];
  5.     };
  6.     void main()
  7.     {
  8.         struct student s;
  9.         printf("%d", sizeof(struct student));
  10.     }

Answer: Option D

Explanation:

9.

What is the output of this C code?

  1.     #include <stdio.h>
  2.     struct student
  3.     {
  4.         char a[5];
  5.     };
  6.     void main()
  7.     {
  8.         struct student s[] = {"hi", "hey"};
  9.         printf("%c", s[0].a[1]);
  10.     }

Answer: Option C

Explanation:

10.

What is the output of this C code?

  1.     #include <stdio.h>
  2.     void main()
  3.     {
  4.         char *a[3] = {"hello", "this"};
  5.         printf("%s", a[1]);
  6.     }

Answer: Option B

Explanation:

11.

Which function is responsible searching in the table?
    (For #define IN 1, the name IN and replacement text 1 are stored in a “table”)

Answer: Option C

Explanation:

12.

In what situation, install function returns NULL?

Answer: Option C

Explanation:

13.

Which algorithm is used for searching in the table?

Answer: Option B

Explanation:

14.

What is the output of this C code?

  1.     #include <stdio.h>
  2.     int main()
  3.     {
  4.         struct p
  5.         {
  6.             char *name;
  7.             struct p *next;
  8.         };
  9.         struct p p, q;
  10.         p.name = "xyz";
  11.         p.next = NULL;
  12.         ptrary[0] = &p;
  13.         strcpy(q.name, p.name);
  14.         ptrary[1] = &q;
  15.         printf("%s\n", ptrary[1]->name);
  16.         return 0;
  17.     }

Answer: Option B

Explanation:

15.

What is the output of this C code?

  1.     #include <stdio.h>
  2.     int main()
  3.     {
  4.         struct p
  5.         {
  6.             char *name;
  7.             struct p *next;
  8.         };
  9.         struct p *ptrary[10];
  10.         struct p p, q;
  11.         p.name = "xyz";
  12.         p.next = NULL;
  13.         ptrary[0] = &p;
  14.         q.name = (char*)malloc(sizeof(char)*3);
  15.         strcpy(q.name, p.name);
  16.         q.next = &q;
  17.         ptrary[1] = &q;
  18.         printf("%s\n", ptrary[1]->next->next->name);
  19.     }

Answer: Option A

Explanation: