puzzle on C Programming language--Part 3 Online Test

1. What are the values printed by the following program?

#define dprint(expr) printf(#expr "=%d\n",expr)

main()

{

int x=7;

int y=3;

dprintf(x/y);

}


2. What can be said of the following program?

main()

{

enum Months {JAN =1,FEB,MAR,APR};

Months X = JAN;

if(X==1)

{

printf("Jan is the first month");

}

}


4. What is the size of the following union. Assume that the size of int =2, size of float =4 and size of

char =1.?

Union Tag{

int a;

flaot b;

char c;

};


5. COnsider the following of c code in two files which will be linked together and executed .

a.c: int i;

main()

{

i = 30;

f1();

printf("%d\n",i)

}

b.c: static int f1()

{

i+=10;

}

which of the following is true ?


5. consider the following program:

# include

class x {

public:

int a;

x();

};

x::x() { a=10; cout

class b:public x {

public:

b();

};

b::b() { a=20; cout

main ()

{ b temp;

}

what will be the output of this prg?




























































Description:

Hi...the following puzzles are the questions which are asked more frequently in IT concern..Try to solve them...if u have any doubts please ask me...thank you...

Discussion

mohanapriya c

hi sana..... i did all your 3 parts and solve 75% in each test.... thanks for the wonderful question and expecting a line answer atleast for each... thanks once again::)

3044 days 14 hours 12 minutes ago

mohanapriya c

hi sana..... i did all your 3 parts and solve 75% in each test.... thanks for the wonderful question and expecting a line answer atleast for each... thanks once again::)

3044 days 14 hours 12 minutes ago

59 Followers

Your Facebook Friends on WizIQ

More Tests By Author

puzzle on C programming language---part 2
10 Questions | 540 Attempts

puzzle in C Programming Language
8 Questions | 7106 Attempts

Explore Similar Courses