MCQ Answers:

1. Pointing to a person - Aunt 

2. How is G related to E - Cannot be determined 

3. A is the uncle of B - None of these. 

4. How is F related to A - Daughter-in-law

5. A goes on a picnic - Sister-in-law 

6. Pointing to a photograph Fasil - Brother 

7. How is C related to A - Granddaughter 

8. Pointing to Vinay in a photograph Ajay - Son 

9. How is F related to C - None of these 

10. Introducing Rajesh, Nalini said - Sister  

11. Who among the following is A's child - E

12. A man said to a lady - Sister 

13. Pointing to a woman, Nitin said - Son 

14. Pointing to a man in the room - Son 

15. If A is sister of B - Aunt


Program solution:


1. C - Stack - Reverse Integers(Id-5304)


#include <stdio.h>

int stack[1000];

int top = -1;


void push(int n){

    stack[++top]=n;

}

int pop(){

    return(stack[top--]);

}


int main ()

{

  int N, value, ctr;

  scanf ("%d", &N);

  for (ctr = 0; ctr <= N - 1; ctr++)

    {

      scanf ("%d", &value);

      push (value);

    }

  while (top != -1)

    {

      printf ("%d ", pop ());

    }

  return 0;

}


2. C - Linked List - Append (Id-5309)


#include<stdio.h>

struct Node

{

  int data;

  struct Node *next;

};

struct Node *head = NULL;

struct Node *tail = NULL;


void append(int value)

{

struct Node *node = malloc(sizeof(struct Node)) ;

node->data = value;

 node->next = NULL;

if (head == NULL)

{

head = node;

tail = node;

return;

}


while(tail->next != NULL) 

{

   tail = tail->next;

tail->next=node;

}

int main ()

{

  int N, value;

  scanf ("%d", &N);

  while (N--)

    {

      scanf ("%d", &value);

      append (value);

    }

  struct Node *ptr = head;

  int sum = 0;

  while (ptr != NULL)

    {

      sum += ptr->data;

      ptr = ptr->next;

    }

  printf ("%d", sum);

}