C,C++ online Test

What will be the output of following code ?

int x = 10;

int main()

{

int x = 20;

cout<< x+::x;

cout<<x+x;

return 0;

}


Name mangling implements which of the following OOP concept ?


Which of the following data member will be accessible by object of following class ?

Class X

{

private :

int a;

int b;

protected :

void init()

{

cout<<"Hello ";

}

int p;

public:

int q;

};


Which of the following files contain srand function ?


what will be output of following program ?

int main()

{

float p =1.25;

int q=5;

cout<<p/q;

}


Which of following is correct ?


In the given program which of the line will give run time error /

int main()

{

01 char *ptr = NULL;

02 gets(ptr);

03 char arr[] = "Hello";

04 cout<<arr;

05 cout<<ptr;

return 0;

}


What will be output of following program ?

void f()

{

static int j =10;

printf("%d",j);

j++;

}

int main()

{

int i;

for(i=0;i<5;i++)

f();

return 0;

}


Which of following ios flag passed in open function of fstream will open a file if it is new file othewise open operation will fail ?


What will be the output of following code ?

int main()

{

int x = 100;

cout<<oct<<x;

return 0;

}










































































Description:

This test will help all the candidates who will be appearing for interview in near future.Every company who require skilled C,C++ programmer will take their technical test which consist of questions mostly based on your understanding of classes,constructors,OOP features etc.This test check your those skills

Comments
ramabrahmam
By: ramabrahmam
318 days 50 minutes ago

fine..it is an excellent test..

ramabrahmam
By: ramabrahmam
318 days 50 minutes ago

fine..it is an excellent test..

ajay
By: ajay
314 days 13 hours 49 minutes ago

a good one

shaily shrivastava
By: shaily shrivastava
312 days 12 hours 30 minutes ago

i think this test is gud bt jus basis on C

venkata saikrishna
By: venkata saikrishna
302 days 18 hours 54 minutes ago

very fine.this is is very useful for the freshers.

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++
15 Questions | 505 Attempts

Give live classes, create & sell online courses

Try it free Plans & Pricing

Connect