Q.1

Does the data type of all elements in the union will be same.

  • True
  • False
Q.2

Is the following declaration correct?
typedef *void (*pfun)(**int, *float);

  • Yes
  • No
Q.3

What will be the output of the program in DOS (Compiler - Turbo C)?

#include<stdio.h>
double i;

int main()
{
    (int)(float)(char) i;
    printf("%d",sizeof(i));
    return}
  • 4
  • 8
  • 16
  • 22
Q.4

What will be the output of the program?

#include<stdio.h>

int main()
{
    char far *near *ptr
    char far *far *ptr
    char far *huge *ptr
    printf("%d, %d, %d\n", sizeof(ptr1), sizeof(ptr2), sizeof(ptr3));
    return
}
  • 4, 4, 8
  • 4, 4, 4
  • 2, 4, 4
  • 2, 4, 8
Q.5

Point out the error in the following program (in Turbo C under DOS).

#include<stdio.h>

union emp
{
    int empno;
    int age;
};

int main()
{
    union emp e = {25};
    printf("%d %d", e.empno, e.age);
    return}
  • Error: Lvalue required
  • Error: Rvalue required
  • Error: cannot initialize more than one union member.
  • No error
Q.6

What will be the output of the program in DOS (Compiler - Turbo C)?

#include<stdio.h>
double i;

int main()
{
    (int)(float)(char) i;
    printf("%d", sizeof((int)(float)(char)i));
    return}
  • 1
  • 2
  • 4
  • 8
Q.7

What will be the output of the program?

#include<stdio.h>

int main()
{
    char huge *near *far *ptr
    char near *far *huge *ptr
    char far *huge *near *ptr
    printf("%d, %d, %d\n", sizeof(**ptr1), sizeof(ptr2), sizeof(*ptr3));
    return
}
  • 4, 4, 4
  • 2, 2, 2
  • 2, 8, 4
  • 2, 4, 8
Q.8

Point out the error in the following program.

#include<stdio.h>
#include<stdlib.h>

int main()
{
    static char *p = (char *)malloc(10);
    return}
  • Error: Lvalue required
  • Error: Rvalue required
  • Error: invalid *p declaration
  • No error
Q.9

It is not necessary to typecast the address returned by malloc().

  • True
  • False
Q.10

We can modify the pointers "source" as well as "target".

  • True
  • False
Q.11

Is the following declaration correct?
char (* ( *f())[])();

  • Yes
  • No
Q.12

Is the following declaration correct?
char far *far *ptr;

  • Yes
  • No
Q.13

What will be the output of the program?

#include<stdio.h>

int main()
{
    char huge *near *far *ptr
    char near *far *huge *ptr
    char far *huge *near *ptr
    printf("%d, %d, %d\n", sizeof(ptr1), sizeof(*ptr2), sizeof(**ptr3));
    return
}
  • 4, 4, 4
  • 2, 4, 4
  • 4, 4, 2
  • 2, 4, 8
Q.14

What will be the output of the program (in Turbo C under DOS)?

#include<stdio.h>

int main()
{
    char huge *near *far *ptr    char near *far *huge *ptr    char far *huge *near *ptr    printf("%d, %d, %d\n", sizeof(ptr1), sizeof(ptr2), sizeof(ptr3));
    return}
  • 4, 4, 8
  • 2, 4, 4
  • 4, 4, 2
  • 2, 4, 8
Q.15

What will be the output of the program?

#include<stdio.h>
typedef void v;
typedef int i;

int main()
{
    v fun(i, i);
    fun(3);
    return
}
v fun(i a, i b)
{
    i s=
    float i;
    printf("%d,", sizeof(i));
    printf(" %d", a*b*s);
}
  • 2, 8
  • 4, 8
  • 2, 4
  • 4, 12
Q.16

Point out the error in the following program.

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

int main()
{
    int show();
    int (*f)();
    f = show;
    display(f);
    return}
void display(int (*ff)())
{
    (*ff)();
}
int show()
{
    printf("IndiaBIX");
}
  • Error: invalid parameter in function display()
  • Error: invalid function call f=show;
  • No error and prints "IndiaBIX"
  • No error and prints nothing.
Q.17

Function can return a floating point number.

  • True
  • False
Q.18

We can allocate a 2-Dimensional array dynamically.

  • True
  • False
Q.19

Is the following declaration correct?
void(*f)(int, void(*)());

  • Yes
  • No
Q.20

What will be the output of the program?

#include<stdio.h>
typedef unsigned long int uli;
typedef uli u;

int main()
{
    uli a;
    u b = -    a = -    printf("%lu, %lu", a, b);
    return}
  • 4343445454, 4343445454
  • 4545455434, 4545455434
  • 4294967295, 4294967295
  • Garbage values
0 h : 0 m : 1 s