More Classes
5th Class
6th Class
7th Class
8th Class
9th Class
10th Class
11th Class
12th Class
NAT I
NAT II
CSS
IQ
General Knowledge
MDCAT
ECAT
GAT General
GAT Subject
Other Links
Go to Home
Online Tests
CS-201 Final Term Exams Preparation Virtual University MCQs With Answers
Question # 1
_______ is used to trace the logic of the program and correct the logical errors.
Choose an answer
Compiler
Editor
Linker
Debugger
Previous
Skip
Next
Question # 2
Consider the following code segment. What will be the output of the following program? int func(int) ; int num = 10 ; int main(){ int num ; num = 5 ; cout << num ; cout << func(num) ; } int func(int x){ return num ; }
Choose an answer
5, 5
10, 5
5, 10
10, 10
Previous
Skip
Next
Question # 3
Which one of the following is the declaration of overloaded pre-increment operator implemented as member function?
Choose an answer
Class-name operator +()
Class-name operator +(int)
Class-name operator ++() ;
Class-name operator ++(int) ;
Previous
Skip
Next
Question # 4
Skill(s) that is/are needed by programmer’s _______________________.
Choose an answer
Paying attention to detail
Think about the reusability
Think about user interface
All of the given options
Previous
Skip
Next
Question # 5
Header file: fstream.h includes the definition of the stream classes __________.
Choose an answer
ifstream, fstream, cout
ifstream, fstream, ofstream
fstream, cin, cout
None of the above
Previous
Skip
Next
Question # 6
The stream insertion and stream extraction operators are already overloaded for ______.
Choose an answer
User-defined data types
Built-in data types http://www.sstutor.com/cpp/stream1.htm
User-defined and built-in data types
None of the given options
Previous
Skip
Next
Question # 7
If we define an identifier with the statement #define PI 3.1415926 then during the execution of the program the value of PI __________.
Choose an answer
can not be replaced
None of the given options
Remain constant
can be changed by some operation
Previous
Skip
Next
Question # 8
Which of the following function call is correct for the function prototype? defaultParameters ( int a, int b = 7, char z = ‘*’ );
Choose an answer
defaultParameters (5);
defaultParameters (5, ‘8’);
defaultParameters (6, ‘#’);
defaultParameters (0, 0, ‘*’, 0);
Previous
Skip
Next
Question # 9
When an array is passed to a function then default way of passing this array is
Choose an answer
By data
By reference
By value
By data type
Previous
Skip
Next
Question # 10
NULL value has been defined in ______ and _________ header files.
Choose an answer
strings.h and iostream.h
ctype.h and conio.c
conio.c and conio.h
stdlib.h and stddef.h
Previous
Skip
Next
Question # 11
What purpose do classes serve?
Choose an answer
Data encapsulation
Providing a convenient way of modeling real-world objects
Simplifying code reuse
All of the given options
Previous
Skip
Next
Back