Jump to content

Test your knowledge!


zaphirer

Recommended Posts

This neat little quiz is from XFire. See what you get :P

 

1. What does this program print, and why?

 

float x = 0.9;if (x == 0.9)printf("Sanity prevails");elseprintf("HUH?");

 

 

A. "Sanity prevails" because it comes first in the list

B. "Sanity prevails" because x = 0.9

C. "HUH?" because floating point numbers are stored in binary and 0.9 cannot be represented exactly

D. The program crashes before printing anything

 

2. Which C++ feature made the STL possible?

A. classes

B. templates

C. references

D. namespaces

 

3. Which is faster: insertion sort or quick sort?

A. insertion sort

B. quick sort

C. they're the same speed

D. it depends on the size of the data set

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.