Question #1:

#include<stdio.h>

void main()

{

  int const *cp;

  int Res,Num=90;

  cp=&Num;

  Res=++(*cp);

  printf(“%d”,Res);

}

  • 90
  • 91
  • Compiler Error
  • Address of Num

Question #2:

#include<stdio.h>

#define CUBE(x) x*x*x

void main()

{

  int Res;

  Res=8/CUBE(2);

  printf(“%d”,Res);

}

  • 2
  • 4
  • 1
  • 16

Question #3:

#include<stdio.h>

#define CUBE(x) (x*x*x)

void main()

{

int Res;

Res=8/CUBE(1+1);

printf(“%d”,Res);

}

  • 1
  • 2
  • 4
  • 16

Question #4:

#include<stdio.h>

enum colors{Red,Blue,Green};

void main()

{

  printf(“%d %d %d”,Red,Blue,Green);

}

  • 1 2 3
  • 0 1 2
  • Error due to %d
  • R B G

Question #5:

#include<stdio.h>

#define scanf() 121

void main()

{

printf(“%d\n”,scanf());

}

  • Error
  • 121
  • Scanf()
  • 0

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s