CFORBEGINNERS.COM

C++ Quiz on First Program

1. What is this called, <iostream>?
    a) directive
    b) pre-processor directive
    c) file

2. If we were to not declare using namespace std, could we still somehow use cout and cin?
    a) Yes
    b) No

3. What would be required to use cout withouth declaring namespace
    a) Nothing
    b) std::cout<<"Hello";
    c) std;;cout<<"Hello";

4. In int main(), what does the int stand for?
    a) integer
    b) initialize
    c) nothing

5. What is the correct way to print to the screen?
    a) cout<<"My first program"<<endl;
    b) cout<< ("My first program);
    c) cin<<"My first program<<endl;

6. What does the 'endl' do?
    a) enters a new line
    b) prints to the screen endl
    c) does nothing

7. In the end of a program we must return and integer, what integer?
    a) 2
    b) 0
    c) 1