Q.1

Which of the statements is correct about the program?

#include<stdio.h>

int main()
{
    int arr[3][= {4};
    printf("%d\n", *(*(*(arr))));
    return}
  • Output: Garbage value
  • Output: 1
  • Output: 3
  • Error: Invalid indirection
Q.2

Which of the following statements correctly declare a function that receives a pointer to pointer to a pointer to a float and returns a pointer to a pointer to a pointer to a pointer to a float?

  • float **fun(float***);
  • float *fun(float**);
  • float fun(float***);
  • float ****fun(float***);
Q.3

If a variable is a pointer to a structure, then which of the following operator is used to access data members of the structure through the pointer variable?

  • .
  • &amp
  • *
  • ->
Q.4

What will be the output of the program ?

#include<stdio.h>

int main()
{
    printf("%c\n", 7["IndiaBIX"]);
    return}
  • Error: in printf
  • Nothing will print
  • print "X" of IndiaBIX
  • print "7"
Q.5

What will be the output of the program ?

#include<stdio.h>

int main()
{
    int x=*y, *z;
    y=&x; /* Assume address of x isand integer is 4 byte size */
    z=y;
    *y++=*z++;
    x++;
    printf("x=%d, y=%d, z=%d\n", x, y, z);
    return}
  • x=31, y=502, z=502
  • x=31, y=500, z=500
  • x=31, y=498, z=498
  • x=31, y=504, z=504
Q.6

What will be the output of the program if the size of pointer is 4-bytes?

#include<stdio.h>

int main()
{
    printf("%d, %d\n", sizeof(NULL), sizeof(""));
    return}
  • 2, 1
  • 2, 2
  • 4, 1
  • 4, 2
Q.7

Are the expression *ptr++ and ++*ptr are same?

  • True
  • False
Q.8

Is there any difference between the following two statements?
char *p=0;
char *t=NULL;

  • Yes
  • No
Q.9

What will be the output of the program ?

#include<stdio.h>

int main()
{
    char *p;
    p="hello";
    printf("%s\n", *&amp*&p);
    return}
  • llo
  • hello
  • ello
  • h
Q.10

What will be the output of the program assuming that the array begins at location

#include<stdio.h>

int main()
{
    int a[2][3][= { {2}, 
                       {};
    printf("%u, %u, %u, %d\n", a, *a, **a, ***a);
    return
}
  • 1002, 2004, 4008, 2
  • 2004, 4008, 8016, 1
  • 1002, 1002, 1002, 1
  • Error
Q.11

What will be the output of the program ?

#include<stdio.h>

int main()
{
    int i=*j, k;
    j = &i;
    printf("%d\n", i**j*i+*j);
    return}
  • 30
  • 27
  • 9
  • 3
Q.12

Point out the error in the program

#include<stdio.h>

int main()
{
    int a[] = {50};
    int j;
    for(j=j<j++)
    {
        printf("%d\n", a);
        a++;
    }
    return}
  • Error: Declaration syntax
  • Error: Expression syntax
  • Error: LValue required
  • Error: Rvalue required
Q.13

Which statement will you add to the following program to ensure that the program outputs "IndiaBIX" on execution?

#include<stdio.h>

int main()
{
    char s[] = "IndiaBIX";
    char t[25];
    char *ps, *pt;
    ps = s;
    pt = t;
    while(*ps)
        *pt++ = *ps++;

    /* Add a statement here */
    printf("%s\n", t);
    return}
  • *pt='';
  • pt='\0';
  • pt='\n';
  • *pt='\0';
Q.14

Which of the statements is correct about the program?

#include<stdio.h>

int main()
{
    int i=    int *j=&i;
    return}
  • j and i are pointers to an int
  • i is a pointer to an int and stores address of j
  • j is a pointer to an int and stores address of i
  • j is a pointer to a pointer to an int and stores address of i
Q.15

What will be the output of the program ?

#include<stdio.h>

int main()
{
    void *vp;
    char ch=*cp="JACK";
    int j=    vp=&ch;
    printf("%c", *(char*)vp);
    vp=&j;
    printf("%c", *(int*)vp);
    vp=cp;
    printf("%s", (char*)vp+2);
    return}
  • JCK
  • J65K
  • JAK
  • JACK
Q.16

Will the program compile?

#include<stdio.h>
int main()
{
    char str[= "IndiaBIX";
    return}
  • True
  • False
Q.17

Is this a correct way for NULL pointer assignment?
int i=0;
char *q=(char*)i;

  • Yes
  • No
Q.18

What will be the output of the program ?

#include<stdio.h>
power(int**);
int main()
{
    int a=*aa; /* Address of 'a' is*/
    aa = &a;
    a = power(&aa);
    printf("%d\n", a);
    return}
power(int **ptr)
{
    int b;
    b = **ptr***ptr;
    return (b);
}
  • 5
  • 25
  • 125
  • Garbage value
Q.19

What will be the output of the program ?

#include<stdio.h>

int main()
{
    char str[= "Hello";
    char *const p=str;
    *p='M';
    printf("%s\n", str);
    return}
  • Mello
  • Hello
  • HMello
  • MHello
Q.20

In the following program add a statement in the function fact() such that the factorial gets stored in j.

#include<stdio.h>
void fact(int*);

int main()
{
    int i=    fact(&i);
    printf("%d\n", i);
    return}
void fact(int *j)
{
    static int s=    if(*j!=    {
        s = s**j;
        *j = *j-        fact(j);
        /* Add a statement here */
    }
}
  • j=s;
  • *j=s;
  • *j=&s;
  • &j=s;
0 h : 0 m : 1 s