Skip to content

Back to module

2. Intro C++


Q) Which of the follow prints one linefeed to the screen?

a) print("Good job!");
b) print("Horray\n\n");
c) println("Well done!");
d) println("Yes!\n");


Q) What are the 3 types of errors in C++ code?

a) Typo, Gilitch, Error
b) Run-time, Debug-time, Local time
c) Logic, Value, Output
d) Compile-time, Run-time, Logic


Q) What is the output of the following?

CPP
    println("I see you said, \"It's true!\"");

a) I see you said, It's true!
b) "I see you said, "It's true!""
c) I see you said, "It's true!"
d) Error: no output.


Answers

c) println("Well done!"); d) Compile-time, Run-time, Logic
c) I see you said, "It's true!"