Computer Science 12
Computer Science 12
Computer Science 12
4) Which one of the following functions is used to read string “Computer Science”?
A) scanf( ) b)getchar( ) c)gets( ) d)getch( )
5) Which escape sequence can be used to insert a Tab in “C” Language?
A. \a B. \b C. \t D. \n
6) Which one of the following is the most suitable for making two ways decision?
A. if statement B. if-else statement C. switch statement D. Nested-if statement
7) How many times “Haripur” will be displayed by the following code? for (int i=1; i<10;i+=2)
printf (“Haripur”);
a) 1 B. 5 C. Infinite D. The loop will not run.
8) A pointer is an:
A. Operator B. Data type C. Keyword D. Variable
9) Which one of the following is the default access specifier of C++ class?
A. Private B. Public C. Protected D. Default
10) Identify the header file needed to read, write, and manipulate the file:
A. ifstream B. ofstream C. istream D. fstream
11) How many values a function can return at a time?
A. One value B. Two values C. Three values D. Any number of values
12)Default mode parameters for ofstream is:
A.ios::out B.ios::in C.ios::binary D.none of these
13.The name of the destructor always preceded by the symbol
A.+ B.% C. # D. ~
14) Ofstream is an:
A. Command B. Class C. Object D. Method
15) The dereference operator is denoted by:
A. * B. & C. % D. @
HSSC-II Examination Computer Science
SECTION-B
Time allowed: 2.40 hours Total Marks: 62
Q.2 Attempt all parts from the following. All parts carry equal marks. (143=42)