Programming Languages - C++

1. Identify the correct statement

a. Programmer can use comments to include short explanations within the source code itself.

b. All lines beginning with two slash signs are considered comments.

c. Comments very important effect on the behaviour of the program

d. both


2. The directives for the preprocessors begin with

a.    Ampersand symbol (&

b.    Two Slashes (//)

c.    Number Sign (#)

d.    Less than symbol (<


3. The file iostream includes

a.    The declarations of the basic standard input-output library.

b.    The streams of includes and outputs of program effect.

c.    Both of these

d.    None of these


4. There is a unique function in C++ program by where all C++ programs start their execution

a.    Start()

b.    Begin()

c.    Main()

d.    Output()


5. Every function in C++ are followed by

a.    Parameters

b.    Parenthesis

c.    Curly braces

d.    None of these


6. Which of the following is false?

a.    Cout represents the standard output stream in c++.

b.    Cout is declared in the iostream standard file

c.    Cout is declared within the std namespace

d.    None of above


7. Every statement in C++ program should end with

a.    A full stop (.)

b.    A Comma (,)

c.    A Semicolon (

d.    A colon (


8. Which of the following statement is true about preprocessor directives?

a.    These are lines read and processed by the preprocessor

b.    They do not produce any code by themselves

c.    These must be written on their own line

d.    They end with a semicolon


9. A block comment can be written by

a.    Starting every line with double slashes (//)

b.    Starting  with /* and ending with */

c.    Starting with //* and ending with *//

d.    Starting with <!- and ending with -!>


10. When writing comments you can

a.    Use code and  /* comment on the same line

b.    Use code and // comments on the same line

c.    Use code and //* comments on the same line

d.    Use code and <!- comments on the same line


Answers

1.    b.  All lines beginning with two slash signs are considered comments.
2.    c. Number Sign (#)
3.    a. The declarations of the basic standard input-output library.
4.    c. Main()
5.    b. Parenthesis
6.    d. None of above
7.    c. A semicolon
8.    d. They end with a semicolon
9.    b. Starting  with /* and ending with */
10.    b. Use code and // comments on the same line

Comments

Popular posts from this blog

Electrical Machines (Three Phase Transformers)

Thermodynamics (Compressible Flow)

Electrical Machines (Special Machines)