C,C++ online Test

Which fo the following header files are necessary for successful execution of following code ?

void main()

{

puts("Hello");

}


What will be the output of following C++ code ?

#include <iostream.h>

class X

{

public:

X()

{

cout<<"Hello"<<endl;

}

};

void main()

{

X ob[5];

}


If the main function in c++ program is declared as int main(int argc,char *argv[]) then which of the following contains the name of program ?


NULL is defined in which of the following header files?


What is the minimum number of queue that is used for implementing priority queue ?


What is the maximum height of binary tree containing 7 nodes ?


Which option correctly describes stable sort ?


Which of the following algorithm has O(n logn) Complexity in worst case?


Which option correctly represents a pointer to function returning int?


Which of the following is false regarding properties of friendship in classes ?


Which of the following explains the meaning of ifstream test(“out.txt”) ?


Which of the following functions are generated by compiler implicitly if not provided explicitly ?


What will be the output of following code snippet assuming that all required header files are included ?int main()

{

int a = 0; int b = 0;

if(a++ && b++)

b = b+2;

printf(%d,a+b);

return 0;

}


Which of the following value of openmode enumeration opens the file in input/read mode only?


Which of the following is true about linked lists?










































Description:

This test cover questions that are mostly asked in C/C++ interviews.It covers all concepts from basic for loops,pointers to advance topics like data structures.

It will help all freshers as well as experienced professionals who are looking for change.This test is my experience of interviews with TCS,DRDO,HCL and CSC.

Tags:

C++  Language  C

Comments
vishal
By: vishal
322 days 7 hours 30 minutes ago

Many wrong answers....:P

chiyinhsu
By: chiyinhsu
322 days 5 hours 11 minutes ago

the answers are wrong, for example, the name of the program is argv[0] not argv[2],the max depth for a binary tree with 7 nodes are 6, the stable sort is a sorting algorithm that preserves the order of equal elements in the list.

Kapil Vermani
By: Kapil Vermani
322 days 1 hours 55 minutes ago

i have not provided any answers.

Kapil Vermani
By: Kapil Vermani
322 days 1 hours 51 minutes ago

i think it has taken default answers can anybody tell me how i can edit test now

Willliam Blystone
By: Willliam Blystone
321 days 22 hours 2 minutes ago

Hi, Vishal

Yes most of your answers seem wrong to me. E.g., The max depth of a 7 node binary tree is not 3. Maybe you were thinking of a 7 node balanced binary tree. Maybe you're just having trouble with the test building tool. Keep trying! :)

Willliam Blystone
By: Willliam Blystone
321 days 21 hours 59 minutes ago

Oops. I intended to address my comment to Vishal. Sorry :)

Willliam Blystone
By: Willliam Blystone
321 days 21 hours 57 minutes ago

Wow. I'm really having trouble with Indian names. That should have been Kapil! :)

Sandeep Kumar Patra
By: Sandeep Kumar Patra
321 days 17 hours 9 minutes ago

ya..........raelly many wrong answers...............ex:-in q no. 13 ,answer should be 0 since........it returns an integer value and 0 is returned in return statement.

shyam
By: shyam
319 days 6 hours 8 minutes ago

9 ans were wrong

pinki
By: pinki
318 days 23 hours 55 minutes ago

Starting from the very first question of the test, many answers are wrong...

Kapil Vermani
By: Kapil Vermani
318 days 12 hours 57 minutes ago

I agreed there are many wrong answers as i hv not selected any answers it has taken all answers by default.

Now i hv uploaded another test plz chk that it has all correct answers

Kapil Vermani
By: Kapil Vermani
318 days 12 hours 56 minutes ago

Also test once uploaded cannot be modified

sagar kumbhar
By: sagar kumbhar
314 days 23 hours 57 minutes ago

sorry sir i am fail but i will try to next test thank you.

vinod
By: vinod
283 days 8 hours 10 minutes ago

Que no 13's answer is wrongggggggggg
it never come inside condition

Want to learn?

Sign up and browse through relevant courses.

Name:
Your Email:
Password:
Country:
Contact no:


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


Sign Up Already a member? Sign In
I agree to WizIQ's User Agreement & Privacy Policy
Kapil Vermani
BrainBench Certified Master C++ Programmer
User
20 Followers
Tests: 3

Your Facebook Friends on WizIQ

More Tests By Author

C++ Class Fundamentals
5 Questions | 180 Attempts

C,C++
10 Questions | 568 Attempts

Give live classes, create & sell online courses

Try it free Plans & Pricing

Connect