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...

Comments
mohanapriya c
By: mohanapriya c
678 days 11 hours 45 minutes ago

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::)

mohanapriya c
By: mohanapriya c
678 days 11 hours 45 minutes ago

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::)

mohanapriya c
By: Shiddu
414 days 12 hours 38 minutes ago

I got 5/5

Want to learn?

Sign up and browse through relevant courses.

or fill this simple form
Name:
Your Email:
Password:
Country:
Contact no.:


Area code Number
Subjects you are interested in:
Word verification: (Enter the text as shown in image)


Sign Up Already a member? Sign In
I agree to WizIQ's User Agreement & Privacy Policy
58 Followers

Your Facebook Friends on WizIQ

More Tests By Author

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

puzzle in C Programming Language
8 Questions | 4941 Attempts

Connect