You are on page 1of 3

Q1) The following block diagram shows the translation process of C++ code to

executable file. What word should be filled at block left blank so that translation
process is complete.

A preprocessor
E) None

B) modified code C) compiler

Q2) what do you get when you run the following program?
#include<iosteam.h>
int main(){
cout<<"hello world!"; return 0;}
A) helloworld
B) error: double quotation mark is not required
C) hello world!
D) error: 'cout' was not declared in this scope
E) error: 'using namespace std' directive is required

D) debugger

Q3) which one of the following best describes what is Identifier is in programming
language.
A) it is a sequence of letters only
B) it is a sequence of letters, underscore and digits
C) it is a sequence of letters, underscore and digits that starts in letter only
D) it is a sequence of letters, underscore and digits that starts with underscore
or letter
E) it is a sequence of letters, underscore and digits that starts with underscore,
letters or digits
F) A &E
G) B & C
Q4) The following code is definition of C++ Class. Which one of the following is
the correct object instantiation for the Class given below?
class Student{
int age;
public:
void setage(int a)
{age=a;}
};
A)student st

B) Student st; C) student st; D) Student st(2); E)class Student st;

Q5) Which one of the following is true about C++ constructor?


A) It is a function B) it has same name with its class C) it is called when object
is destroyed D) it is called when object is created E) A, B, C F) B, D G) A,B,D
Q6) The default access specifier in C++ class definition is _______.
A public

B) protected

C) private

D)A & C E)All

Q7) Function declaration include the following except

A) Function's return type


B) Function's name
C) Function's dimension
D) Number and type of argument
E) None
Q8) All are true in the C++ programming except
A
B
C
D

every function has at least one statement block which could be empty
A void function can return without using return statement
5-age can be the name of any functions
no place in the program is allowed to call the main function

You might also like