Q.1

In the following code, the P2 is Integer Pointer or Integer?

typedef int *ptr;
ptr pp
  • Integer
  • Integer pointer
  • Error in declaration
  • None of above
Q.2

What will be the output of the program?

#include<stdio.h>

int main()
{
    enum color{red, green, blue};
    typedef enum color mycolor;
    mycolor m = red;
    printf("%d", m);
    return}
  • 1
  • 0
  • 2
  • red
Q.3

Is the following declaration acceptable?

typedef long no, *ptrtono;
no n;
ptrtono p;
  • Yes
  • NO
Q.4

Is there any difference in the #define and typedef in the following code?

typedef char * string_t;
#define string_d char *;
string_t ssstring_d ss
  • Yes
  • No
Q.5

In the following code snippet can we declare a new typedef named ptr even though struct employee has not been completely declared while using typedef?

typedef struct employee *ptr;
struct employee
{
    char name[20];
    int age;
    ptr next;
}
  • Yes
  • No
Q.6

Are the properties of i, j and x, y in the following program same?

typedef unsigned long int uli;
uli i, j;
unsigned long int x, y;
  • Yes
  • No
Q.7

typedef's have the advantage that they obey scope rules, that is they can be declared local to a function or a block whereas #define's always have a global effect.

  • Yes
  • No
Q.8

In the following code what is 'P'?

typedef char *charp;
const charp P;
  • P is a constant
  • P is a character constant
  • P is character type
  • None of above
Q.9

What will be the output of the program?

#include<stdio.h>

int main()
{
    typedef int arr[5];
    arr iarr = {5};
    int i;
    for(i=i<i++)
        printf("%d,", iarr[i]);
    return
}
  • 1, 2, 3, 4
  • 1, 2, 3, 4, 5
  • No output
  • Error: Cannot use typedef with an array
Q.10

Point out the error in the following code?

typedef struct
{
    int data;
    NODEPTR link;
}*NODEPTR;
  • Error: in *NODEPTR
  • Error: typedef cannot be used until it is defined
  • No error
  • None of above
Q.11

What will be the output of the program?

#include<stdio.h>

int main()
{
    typedef float f;
    static f *fptr;
    float fval =    fptr = &fval;
    printf("%f\n", *fptr);
    return}
  • 9
  • 0
  • 90.000000
  • 90
Q.12

What is x in the following program?

#include<stdio.h>

int main()
{
    typedef char (*(*arrfptr[3])())[10];
    arrfptr x;
    return}
  • x is a pointer
  • x is an array of three pointer
  • x is an array of three function pointers
  • Error in x declaration
Q.13

What will be the output of the program?

#include<stdio.h>

int main()
{
    typedef int LONG;
    LONG a=
    LONG b=
    float c=
    c=b;
    b+=a;
    printf("%d,", b);
    printf("%f\n", c);
    return
}
  • 72, 68.000000
  • 72.000000, 68
  • 68.000000, 72.000000
  • 68, 72.000000
Q.14

What will be the output of the program?

#include<stdio.h>

typedef struct error {int warning, err, exception;} ERROR;
int main()
{
    ERROR e;
    e.err=
    printf("%d\n", e.err);
    return
}
  • 0
  • 1
  • 2
  • Error
0 h : 0 m : 1 s