Hssc-2 (Pets CPTR MCQS)
Hssc-2 (Pets CPTR MCQS)
School: Army Public School & College (Girls) Psc Subject: Cptr Science
Developer: Ms Humera Wadood Cl / lvl: HSSC – II Title of the Chapter / Concept: Ch # 1: Operating System
of a process?
Option Ref Ref Bloom’s
Ser MCQ Ans
A B C D Pg Book domain
In an office, a
computer is
connected to a printer,
which function of the
operating system File Input/output Process Network
3. B 17 NBF Application
manages the Management Management Management Management
communication
between the computer
and the printer to print
documents?
Which of the following Only one The system is
is a benefit of using a Multiple users can It is faster than
person can use more secure
4. share resources like a single-user B 14 NBF Knowledge
multi-user operating the computer at than a single-
system? files and printers system
a time user system
Which operating
system is open-source D 9 NBF Knowledge
7. Windows 10 macOS iOS Linux
and free to use among
these?
When a user saves a
document, which
function of the
operating system Task Input/output Protection
8. File Management B 16 NBF Application
manages the storage Scheduling Management System
of the file and keeps
track of its location for
future retrieval?
Option Ref Ref Bloom’s
Ser MCQ Ans
A B C D Pg Book domain
In multiprocessing,
what is the term used
to describe the
Multi- Time-sharing Parallel Batch
13. simultaneous C 13 KPK Understanding
programming processing processing
execution of two or
more processes on
multiple processors?
A company is
developing a new
smartphone. What
Windows Mac OS Linux Android
14. type of operating D 16 KPK Understanding
system is typically
used in modern
smartphones?
What major benefit
Improved hardware
does
Increased user utilization through Better privacy
multiprogramming Less electricity
15. interface overlapped I/O and and data B 13 NBF Understanding
provide in an usage
responsiveness CPU processing security
operating system?
Option Ref Ref Bloom’s
Ser MCQ Ans
A B C D Pg Book domain
Which operating
system is commonly
found in embedded
Windows Embedded
systems like digital C 16 KPK Understanding
16. Embedded Mac OS Linux Android
cameras, smart TVs,
and microwave
ovens?
When a process is
waiting to be assigned
19. Ready Running New Blocked A 18 NBF Knowledge
to the processor, what
is itsl state?
When a process is
waiting for a resource
21. that is being used by Ready Running Blocked Suspended C 18 NBF Understanding
another process, what
state is it in?
Option Ref Ref Bloom’s
Ser MCQ Ans
A B C D Pg Book domain
Which type of
operating system is
most suitable for a
computer used in a
Real-time Multi-user Mobile
scientific research Network Operating
22. Operating Operating Operating C 14 NBF Application
laboratory where System
System System System
multiple users need to
run complex
simulations
simultaneously?
Which unit of
execution is run in
23. Program Thread Process Data B 19 NBF Knowledge
shared memory
space?
Option Ref Ref Bloom’s
Ser MCQ Ans
A B C D Pg Book domain
Windows was
25. developed in the year: mid 1970s mid 1980s mid 1990s mid 1960s B 11 NBF Knowledge
In which of the
following operating
system executes more
than one process Multitasking Multiprogramming Multithreading Multiprocessing
26. D 20 NBF Understanding
simultaneously on
multiprocessor
system?
Option Ref Ref Bloom’s
Ser MCQ Ans
A B C D Pg Book domain
on the server?
In multiprogramming
one program is in
First program is Second program is Third program
CPU at a time and A 13 NBF Understanding
30. completed or completed or is completed or Only A and C
other program will
blocked. blocked. blocked.
have to wait until?
Which operating
system is designed to Batch
Real-time Time Sharing
execute a specific set Processing Distributed
31. Operating Operating A 13 NBF Knowledge
of jobs repeatedly Operating Operating System
System System
without human System
intervention?
An operating system
32. developed by Apple Windows Linux Unix Mac OS D 11 NBF Knowledge
A module of an
operating system
responsible for the
coordination and Command Network
33. File Manage Memory Manager B 17 KPK Understanding
movement of data Interpreter Manager
between registers,
cache ,RAM and disk
storage is known as:
Each processor
Which of the following All processors
Only one may execute a Processors are
is a characteristic of execute the same
34. processor is different not allowed to C 13 KPK Understanding
multiprocessing program
used program share data
systems? simultaneously
independently
Option Ref Ref Bloom’s
Ser MCQ Ans
A B C D Pg Book domain
In multiprogramming,
what is the term used
to describe the
Batch
35. process of switching Time-sharing Context switching Multi-tasking B 10 KPK Knowledge
processing
between different
programs to keep the
CPU busy?
APSACS PREP FOR ENTRY TESTS (PETS) PROGM – HSSC
Developer: Mr. Tausif Mumtaz Cl / Lvl : XII Title of the chapter / Concept : SDLC
SDLC is a
Hardware Software Chemical Mechanical
1. process that is B 25 NBF understanding
Engineering Engineering Engineering Engineering
used in the field
The term
2. “system” is the Greek French English German A 36 NBF understanding
word of
It delivers quality
software that Astera Contour
3. Agile development SDLC C 25 NBF Analysis
meets the system Software Software
requirement
Which one is
4. NOT for sponsor Planner Developer Salesman D 26 NBF understanding
stakeholders?
Which team is Designing
Project Analysis
5. responsible for Coding team management A 26 NBF Understanding
management team team
identifying the team
stakeholder for
their requirement,
expectation, and
a successful
project?
SDLC have
6. Nine Ten Eleven Twelve B 26 NBF Understanding
phases
In which phase of
SDLC the
requirement are
Design
7. documented and Planning Phase Defining Phase Testing Phase C 27 NBF Analysis
Phase
approved from
customer or
company.
Which phase of
SDLC is most
suitable for the
Planning
8. designing and Testing Phase Design Phase Defining Phase D 27 NBF Analysis
Phase
development of
product
requirement?
To meet the Design
9. Planning Phase Defining Phase Testing Phase A 27 NBF Understanding
objective of the Phase
project is
determined SDLC
phase is
considered
Which phase is
chosen for the
estimation of
resources such Testing
10. Defining Phase Planning Phase Coding Phase C 27 NBF Analysis
as personnel and Phase
costs with
concept of the
new product?
Which phase of
SDLC is if all the
information is
Defining
11. analyzed to see Planning Phase Testing Phase Coding Phase A 27 NBF Analysis
Phase
for an alternative
solution to create
the new product?
SDLC ____
Phase is used to Testing Feasibility
12. Defining Phase Planning Phase D 27 NBF Understanding
access the Phase phase
strengths and
weaknesses of
the proposed
system.
Which of the
following is used
to improve a
project and
Planning
13. achieve desire Testing Phase Feasibility phase Defining Phase C 27 NBF Understanding
Phase
result by
presenting
directions of
activities?
Feasibility studies
depend primarily
Proposed Approved
14. on the areas in Analyzed projects Desired projects A 27 NBF Understanding
projects projects
which _________
are Implemented.
Feasibility study
*is one of the
15. important steps in Four Five Six Seven B 27 NBF Understanding
SDLC divided
into form.
Which of the
following is NOT Economic Operational Non-Technical Schedule
16. C 27 NBF Understanding
taken as a type of Feasibility Feasibility Feasibility Feasibility
feasibility study?
During the
analysis phase
17. the project team End user Customer Developer Designer A 28 NBF Analysis
determines the
requirements of
In which phase
the end user
requirements
Testing Feasibility
18. determine with Defining Phase Analysis Phase C 28 NBF Understanding
Phase phase
the assistance of
client focus
groups.
In analysis phase
which team
decide whether
Designing
19. the project should Project team Coding team Testing team A 28 NBF Understanding
team
go ahead with
available
resources or not.
Which of the
following team
asks some
20. specific queries Coding team Testing team Designing team Project team D 28 NBF Understanding
during the
analysis of a
project.
Which one is the
process of
determining user Requirement Software Hardware Network
21. A 28 NBF Application
expectations for a Engineering Engineering Engineering Engineering
new or modified
system?
___________ is a
set of activities
used to identify
and communicate
Software Hardware Requirement Network
22. the purpose of a C 28 NBF Application
Engineering Engineering Engineering Engineering
software system
and frame work in
which it will be
used.
Requirement
Engineering
23. Two Three Four Five B 28 NBF Understanding
consists of
number of steps
Which one is
NOT considered Requirement Requirement Requirement Requirement
24. D 28 NBF Understanding
in Requirement gathering validation management testing
Engineering
The primarily part
of any software /
Requirement Requirement Requirement Requirement
25. system C 28 NBF Understanding
validation management gathering testing
development
process is
Which step is
most suitable for
meeting with Requirement Requirement Requirement Requirement
26. D 28 NBF Understanding
customers and testing validation management gathering
market
requirements
How many types
exist in
27. Two Three Four Five A 28 NBF Understanding
Requirement
gathering?
Which of the
following
requirements is
suitable to specify
Requirement Functional Requirement Non-Functional
28. the software B 28 NBF Understanding
validation requirement gathering requirement
functionality to
enable user to
accomplish their
tasks?
Which type of
requirements
specify criteria for Functional Requirement Non-Functional Requirement
29. C 28 NBF Understanding
the judgment of requirement gathering requirement validation
the operations of
a system?
____________ is
concerned with
examining the
requirements to Requirement Requirement Requirement Requirement
30. B 28 NBF Analysis
certify that they testing validation management gathering
meet the
intentions of the
stakeholders.
In
______________
the requirements
elicited are
Requirement Requirement Requirement Requirement
31. reviewed to D 29 NBF Analysis
management gathering testing validation
check that
requirements are
complete and
accurate.
Which of the
following
requirements
performed to
Requirement Requirement Requirement Requirement
32. ensure that the C 29 NBF Analysis
gathering testing management validation
software
continues to meet
the expectations
of users?
Which
requirements Requirement Requirement Requirement Requirement
33. C 29 NBF Analysis
needs to gather gathering testing management validation
new requirements
from sources of
change?
“Architectural”
phase of a Coding Analysis
34. Design phase Testing Phase A 29 NBF Analysis
system design Phase Phase
represented for
Which team
determines the
most logical
Designing
35. design and Project team Coding team Testing team A 29 NBF Understanding
team
structures for
data flow and
storage?
How many
different
structures a
36. Two Three Four Five A 29 NBF Understanding
design phase
normally
consists?
Which technique
is a specific
37. Design Layout Algorithm Flowchart C 29 NBF Understanding
procedure for
carrying out the
solution of a
problem?
A _______ is a
type of diagram
38. that represents Algorithm Flowchart Design Layout B 29 NBF Understanding
an algorithm or a
process.
In which of the
following
39. Analyzing Designing Documenting Coding D 29 NBF Application
flowchart is NOT
used.
Which symbol is
40. used for I/O Parallelogram Rectangle Diamond Terminal A 30 NBF Understanding
operation?
Which symbol is
41. used for Process Parallelogram Rectangle Diamond Terminal B 30 NBF Understanding
operation?
Which symbol is
42. used for condition Parallelogram Rectangle Diamond Terminal C 30 NBF Understanding
operation?
A diamond
43. Two Three Four Five A 30 NBF Understanding
symbol has exit
During the
construction
phase developers Testing
44. Defining Phase Analysis Phase Design phase D 31 NBF Analysis
execute the plans Phase
laid out in
____________.
In which phase
test data is
prepared and
Analysis construction
45. processed as Testing Phase Design phase C 31 NBF Analysis
Phase phase
many times as
necessary to
refine the code.
The actual user
interface is
construction
46. designed by Analysis Phase Design phase Coding Phase D 31 NBF Analysis
phase
developers in
_______
Coding is also Computer Computer Software Software
47. A 31 NBF Understanding
called programming software package program
In which phase all
Coding Verification
48. aspects of the construction phase Testing Phase D 31 NBF Understanding
Phase Phase
system are tested
for functionality
and performance.
The execution of
a programming
49. Debugging Testing Verification Validation B 31 NBF Understanding
modules to find
errors is called
To evaluate the
attribute or
50. capability of a Coding Verification Validation Testing D 31 NBF Understanding
program is the
purpose of
It is the process
of checking the
items for
consistency by
51. Testing/Verification Verification Testing/Validation Validation A 31 NBF Analysis
evaluating the
results against
prespecified
requirements.
It is set of
Software Software Software
52. activities that are Software Coding B 32 NBF Understanding
implementation deployment Testing
used to make the
software
available for use.
Deployment is
53. SDLC phase also Implementation Conversion Maintenance Activation A 32 NBF Understanding
known as
How many
techniques are
54. Three Four Five Six B 32 NBF Understanding
commonly used
for deployment
In which
technique of
deployment, the
Phased Direct Pilot
55. old system Parallel method C 32 NBF Analysis
method implementation implementation
completely
replaced by new
system.
Which of the
following method
encountered the
Phased Direct Pilot
56. problems of the Parallel method A 32 NBF Analysis
method implementation implementation
new system and
corrected without
the loss of data.
In which method
of deployment,
Phased Direct Pilot
57. the old system is Parallel method B 32 NBF Analysis
method implementation implementation
progressively
discarded.
Which one of the
following
methods of
implementation is
Phased Direct Pilot
58. used for the new Parallel method D 33 NBF Analysis
method implementation implementation
system
installation for a
small number of
users.
In all phases of
SDLC which one Testing Maintenance Deployment
59. Coding Phase C 33 NBF Understanding
is ongoing Phase Phase Phase
process.
Which one is
NOT suitable for
60. Repairing Replacement Modification Enhancement B 33 NBF Understanding
maintenance
phase in SDLC?
SDLC activities
are performed by
61. different groups Personnel End user Coder Analyst A 33 NBF Understanding
of people and
individuals ____.
Personnel are
professional
62. Four Five Six Seven C 33 NBF Understanding
having
classification
Which one of the
personnel provide
consistency of
success of the System Management
63. Project Manager Programmer D 34 NBF Understanding
software with Analyst Team
regard to Time,
Cost and Quality
objectives.
A ______ is a
professional
System Management
64. responsible for Project Manager Programmer A 34 NBF Understanding
Analyst Team
planning,
execution and
closing of any
project.
___________
has expertise in a
variety of
programming
System Management
65. languages, Project Manager Programmer B 35 NBF Understanding
Analyst Team
operating system
and computer
hardware
platform.
Which of the
following
personnel
preparing graphs,
table and System Management
66. Project Manager Programmer C 35 NBF Understanding
analytical data Analyst Team
display which
shows the
progress of
program.
Which of the System Management
67. Software Tester Programmer A 35 NBF Understanding
following Analyst Team
personnel having
specialty in
testing program
using different
testing
techniques
Which one are
the real
evaluators of
System
68. software product Software Tester Programmer Customers D 36 NBF Understanding
Analyst
by using it and
identify its merits
and demerits.
Which one of the
following interact
with designer to System Management
69. Project Manager Programmer B 35 NBF Understanding
understand Analyst Team
software
limitation.
Which one of the
System Management
70. following Project Manager Programmer D 34 NBF Understanding
Analyst Team
personnel reduce
risk associated
with the project.
A customer is an
individual or an
organization that
System
71. is a current or Software Tester Programmer Customers D 36 NBF Understanding
Analyst
potential buyer or
user of the
software product.
APSACS 'PREP FOR ENTRY TESTS (PETS) PROGM – HSSC
Subject: Computer Science
Developer: Ms Bushra Soomro Cl / Ivl : HSSC II Title of the Chapter I Concept: CH#3- Object Oriented Programming in C++
Option
An Ref Ref Bloom's
Ser MCQ
s Pg Book domain
A B C D
What is more important in executing a
Programming
1. set of instructions in a computer Sequence Repetition Control B 63 KPB Understanding
logic
program?
A type of language in which
Machine Assembly High level Natural
2. instructions consist of binary form (0’s A 41 NBF Knowledge
language language language language
and 1’s ) is called:
The process of converting source code Understanding
3. into object code is known as: Compilation Debugging Linking Information A 134 PTB
In C++, character constants are written Double quotes Single quotes Exclamation Pound
37. B 152 PTB Understanding
within: (") (‘) points {!) signs (#
39. The constants are also called? const preprocessor literals variables C 142 PTB Knowledge
49. In C++, gets stand for ? get std get stream get string get str C 171 PTB Understanding
In C++ language, two conditions can Arithmetic Relational Logical Bitwise Understanding
59. C 89 BTB
be joined by using Operators Operators Operators Operators
156-
60. a + = b is equivalent to: b+=a a=+b a = a+b b= b+a C PTB Application
157
top to
In which direction does the left to right right to left bottom to
80. bottom B 65 NBF Analysis
assignment operation will take place? top
#include <iostream>
using namespace std;
int main() {
84. 1000 11 1010 1001 C PTB 157 Evaluate
int i, j;
j = 10;
i = (j++, j + 100, 999 + j);
cout << i;
return 0;
}
What will be the output of the following
C++ code?
#include <iostream>
using namespace std;
int main()
{
85. 50 60 70 90 A PTB 157 Evaluate
int a = 20, b = 10, c = 15, d = 5;
int e;
e = a + b * c / d;
cout << e << endl;
return 0;
}
APSACS PREP FOR ENTRY TESTS (PETS) PROGM - HSSC
School: Army Public School & College (Girls) Psc Subject: Cptr Science
Developer: Ms Humera Wadood Cl / lvl: _HSSC - II__ Title of the Chapter / Concept: Chapter # 4 Control Structures
Option Ref Ref Bloom’s
Ser MCQ Ans
A B C D Pg Book domain
do {
while for (initialization ;
What is the correct syntax statement; } do { statement; }
1. (condition) condition; update) A 83 NBF Knowledge
for a while loop? while while (condition);
{statement } statement;
(condition);
What happens if the
The program
condition in an if The program
An error is continues to the The program
2. statement is false and enters an C 71 NBF Understanding
generated next statement terminates
there is no else infinite loop
after the if block
statement?
To check an
What is the purpose of the To define a To create a additional condition To terminate the
4. C 74 NBF Understanding
else if statement in C++? new variable loop if the preceding if program
condition is false
Option Ref Ref Bloom’s
Ser MCQ Ans
A B C D Pg Book domain
It moves to It exits the switch
In a switch statement, the next case statement,
It terminates It is not allowed in
5. what is the role of the without transferring control D 77 NBF Knowledge
the program a switch statement
break statement? executing the to the statement
current one following the switch
It leads to fall-
What happens if there is through, and
no break statement in a It generates a It causes a subsequent cases It has no effect on
6. C 77 NBF Understanding
case block in a switch compiler error runtime error are executed until a the program
statement? break or the end of
the switch
Inside a loop
to skip the
remaining
code in the In functions to skip
Where can the continue Within any Within switch
17. current certain lines of B 87 NBF Knowledge
statement be used? block of code statements
iteration and code
continue with
the next
iteration
In if statement, test
condition/expression is
22. { } [ ] < > () D 71 NBF Knowledge
written within these
delimiters:
the body of
the logical
the loop will
What is wrong with the operator &
be executed the test condition is the test condition is
29. following code: cannot be C 83 NBF Understanding
infinite always false always true
while ((i< 10) && (i > 24)) used in a test
number of
condition
times
if (x % 2 != 0) then value
37. odd even prime negative A 83 NBF Understanding
of x will be:
Developer: Mr Fahad Aman CI /lvl: HSSC-II Title of the Chapter/ Concept: Array & String
Options Ref Ref Bloom's
Ser MCQs
A B C D Ans Pg Book Domain
1 The following is the general form of declaration of array datatype arrayname[arraysize]; datatype arraysize[arrayname]; arrayname[arraysize]; datatype arrayname(arraysize); a 97 NBF Analyses
The following is the general form of declaration of two dimensional datatype datatype datatype datatype
2 b 103 NBF Knowledge
array arrayname[row+column]; arrayname[row][column]; arrayname[column][row; arrayname[row*column];
5 which functions is used for concatenation or joining of two strings. strcmp(); strcpy(); strlen(); strcat(); d 110 NBF Knowledge
6 Which functions is used to return the length of a string. strlen(); strcmp(); strcat(); strcpy(); a 110 NBF Knowledge
8 Which of the following is correct declaration of array? int arr; int arr[10]; int arr{10}; int arr(10); b 113 NBF Understanding
10 which of the following statements will replace 10 with 20. arr[2][3] = 20; arr[0][10] = 20; arr[10][0] = 20; arr[10] = 20; d 113 NBF Understanding
contigous allocation of memory is used to process large amount We can store different type of
12 Incorrect statement about An array: Always begin atindex 0 d 204 IT SERIES Knowledge
made up of elements of data of same type data
Every element in array has same The array size is fixed after it is the declared array size must be Every element in array has
13 Which of the following statement is not true? d 205 IT SERIES Knowledge
type created a constant expression different type
14 Each element of an array has its own: Membername Index uper bound dot operator b 205 IT SERIES Knowledge
18 The index of the first element of an array ias always: 0 2 4 1 a 205 IT SERIES Understanding
19 What is the repesentation of the third element of an array called n? n[2] n[3] n[1] n[4] a 205 IT SERIES Understanding
20 Each element in arrqay has symbol ` unique index order data type b 205 IT SERIES Knowledge
21 Which of the following declares an array of 10 elements? float n[9] float n(9) float n[10] none c 205 IT SERIES Knowledge
Options Ref Ref Bloom's
Ser MCQs
A B C D Ans Pg Book Domain
22 Which of the following assigns the value 3.2 to first element? n(0)=3.2 n[0]=3.2 n(1)=3.2 n[1]=3.2 b 205 IT SERIES Understanding
25 How many elements are in int n[1000]? 1000 998 0 999 a 205 IT SERIES Understanding
28 Which of the following is correct int[6]={4.7.8.2.9.5}; int[6] {4.7.8.2.9.5}; int a [6]={4.7.8.2.9.5}; int a [6]{4.7.8.2.9.5}; c 205 IT SERIES Understanding
31 Which of the following is not valid: int i[]={3.4.3.2]; int i[4]={3.4.3.2]; double d[30]; int arr[10]; a 206 IT SERIES Understanding
32 A two dimensional array can be viewed as Argument.Parameter increment. Decrement rows,columns none c 206 IT SERIES Analyses
33 An array can be easily stepped through by using a: if switch for loop While loop c 206 IT SERIES Analyses
34 Which one declares an array with 3 rows and 5 columns? A double array [3].[5]; int array[3](int[5]); double array[3][5]; double array[3.5]; c 206 IT SERIES Analyses
35 Assume int t[]={1,2,3,4} What is t[4]? 0 3 4 t[4] is beyond array size d 206 IT SERIES Understanding
36 Which one is correct array for 10 rows and 5 columns? int [10][5] array; int array[10][5]; int arr [5][10]; none c 206 IT SERIES Knowledge
int a[4]={3.0.1.2}
37 3,2 0,2 3,0 0,4 c 206 IT SERIES Analyses
values of a[0] and a[1] are:
38 int sum[2][3]={(1,2),(3,4),(5,6)}; assigns a value 2 to num[1][2] assigns a value 4 to num[1][2] gives an error message assigns a value 3 to num[1][2] c 206 IT SERIES Knowledge
42 A string costant is written in: single quotes double quotes without quotes parenthes b 206 IT SERIES Analyses
44 If the string need to store 25 cahracter, how is it defined? char str[25] char str[24] char str[26] char str[] a 207 IT SERIES Knowledge
45 If char city[ ]="Karachi"; what will be the size of string variable city? 8 7 9 none a 207 IT SERIES Analyses
46 Which is the correct statement? char str[ ]= "Object oriented' char str[20]="Object oriented" char str="Object oriented" Both a and b d 207 IT SERIES Knowledge
Options Ref Ref Bloom's
Ser MCQs
A B C D Ans Pg Book Domain
Which of the following functions is used to copy one string to
47 strcpy strcmp strcat strcant a 207 IT SERIES Analyses
another?
49 Which function is used to compare two strings? strcpy strcmp strcat strcant b 207 IT SERIES Analyses
50 What will strcmp() function return if string 1 and string 2 are same? 0 1 -1 none a 207 IT SERIES Understanding
53 Which function is used to return the length of a string? strlen strlength len strsize a 207 IT SERIES Analyses
54 If x=5 which one accesses the seventh element is array A? A[x++] A[++x] A[7] A[x] a 207 IT SERIES Understanding
57 Which one declares an array with 2 rows and 2 columns? A double array [2].[2]; int array[1](int[2]); double array[2][2]; double array[1.1]; c 206 IT SERIES Knowledge
58 Which of the following declares an array of 15 integer elements? float n[9] float n(9) float n[10] int n[15] d 205 IT SERIES Understanding
int n[5]={3.0.1.2,5}
59 3,2 0,2 0,5 0,4 b 206 IT SERIES Understanding
values of a[1] and a[4] are:
what is the output?
60 Int n[4]={8.7.6.3}; 6 -1 1 3 a 205 IT SERIES Knowledge
cout<<n[2];
61 How many elements are in int n[500]? 500 499 501 488 a 205 IT SERIES Understanding
63 What is the repesentation of the fourth element of an array called n? n[2] n[3] n[1] n[4] b 205 IT SERIES Knowledge
64 The index of the second element of an array is always: 0 2 4 1 d 205 IT SERIES Knowledge
65 If char str[ ]="fbise'"; what will be the size of string variable city? 8 7 9 6 d 207 IT SERIES Knowledge
68 If char city[ ]="lahore"; what will be the size of string variable city? 8 7 9 6 b 207 IT SERIES Knowledge
69 Which one declares an array with 6 rows and 2 columns? A double array [6].[5]; int array[6](int[2]); double array[6][2]; double array[6.2]; c 206 IT SERIES Analyses
Options Ref Ref Bloom's
Ser MCQs
A B C D Ans Pg Book Domain
what is the output?
70 Int n[]={16.20.26.27.12}; 16 20 26 27 d 205 IT SERIES Understanding
cout<<n[3];
Every element in array has same The array size is not 'fixed after it the declared array size must be Every element in array has
71 Which of the following statement is true about array? a 205 IT SERIES Analyses
type is created a variable expression different type
APSACS PREP FOR ENTRY TEST (PETS) PROGRAM HSSC
void display();
int display();
26. Which is used to keep the call by
Static Constant Absolute Virtual A 149 KPK Understanding
reference value as intact?
27. By default, how is the value passed in By
By Value By Pointer By Object A 149 KPK Understanding
C++? Reference
28. What will be the output of the following
C++ code segment?
void copy (int& a, int& b, int& c)
{
a *= 2;
b *= 2;
c *= 2;
2510 254 2614 137 C 132 NBF Application
}
int main ()
{
int x = 1, y = 3, z = 7;
copy (x, y, z);
cout <<x<<y<<z;
return 0;
}
29. What will be the output of the following
C++ code segment?
void myvalue(int &x)
{
x = 20; 10 20 30 0 B 132 NBF Application
}
int main()
{
int x = 10;
myvalue(x);
cout << x;
return 0;
}
30. What will happen when we use void as It will It will not It may or It will not
return return may not return
return type of a function? B 120 NBF Knowledge
value to value to return value to its
its caller its caller value to caller by its
its caller object
31. What return type will be used if you are
static const virtual void D 120 NBF Knowledge
not intended to get a return value?
32. What should be return type of the function
that is supposed to print the table of a static const virtual void D 120 NBF Understanding
number?
33. Where does the return statement return To main To caller To same Ends the
the execution of the program? B 134 KPK Understanding
function function function program
70. By using pointers, how many value(s) can Single Double Triple Multiple D 161 KPK Knowledge
be returned from function? value values values values
TOS: Table of Specification
32. What should be return type of the function that is supposed to print
the table of a number?
P
33. Where does the return statement return the execution of the P
program?
34. What will be the output of the following C++ code segment?
void Sum(int a, int b, int & c)
{
a = b + c;
b = a + c;
c = a + b;
} P
int main()
{
int x = 2, y =3;
Sum(x, y, y);
cout << x << y;
return 0;
}
35. What will be the output of the following C++ code segment?
int max(int a, int b )
{
return ( a > b ? a : b );
}
P
int main()
{
int i = 5;
int j = 7;
cout << max(i, j );
return 0; }
36. Which value will function take when both user and default values are P
given?
37. What will be the output of the following C++ code?
int func(int m = 10, int n)
{
int c;
c = m + n;
return c; } P
int main()
{
cout << func(5);
return 0;
}
38. Where does the execution of the program starts? P
39. Which of the following is used to terminate the function declaration? P
40. Which is more effective while calling the functions? P
41. What is the scope of the variable declared in the user defined
function?
P
42. Which of the following function declaration using default arguments
is incorrect?
P
void subject()
{ cout<<"Science"; }
P
int main()
{ subject();
return 0; }
Total 70 28 28 14
APSACS PREP FOR ENTRY TESTS (PETS) PROGM - HSSC
School: APSAC FFC ATD Subject: Computer Science
Developer: Ms. Mahnoor Imran Title of the Chapter / Concept: Chapter#8 (Classes & Objects)
Option Ref Ref Bloom's
Ser MCQ Ans
A B C D Pg Book domain
Developer: Ms. Mahnoor Imran Title of the Chapter / Concept: Chapter#9 (File Handling)
Ref Ref Bloom's
Option Ans
S# MCQ Pg Book domain
A B C D
Which library is used in
1. iostream fstream ifstream cfile B 194 KPK Knowledge
C++ for file handling?
2. A file is stored in Ram Hard Disk ROM Cache B 194 KPK Knowledge
Which of the following are
3. Opening Closing Read/ Write ALL D 195 KPK Knowledge
file handling operation?
The classes ifsteam,
4. ofstream and fstream are iostream conio.h fstream.h ifstream.h C 195 KPK Knowledge
defined in the header file
To handle text
To manage
What is the purpose of file To manipulate input/output To control
5. memory B 194 KPK Understanding
handling in C++? directories operations on user input
allocation
files
What is the default mode
6. ios::in ios::out ios::binary ios::app B 176 NBF Knowledge
for file opening in C++?
Which function is used to
7. open() fopen() ifstream() ofstream() D 176 NBF Knowledge
open a file in C++?
Which mode is used for
ios::in |
8. reading and writing in a file ios::in ios::out ios::app D 177 NBF Knowledge
ios::out
simultaneously?
APSACS PREP FOR ENTRY TESTS (PETS) PROGM - HSSC
School: APSAC FFC ATD Subject: Computer Science
How do you close a file in
9. close() fclose() closefile() fclosefile() A 200 KPK Knowledge
C++?
Which operator is used to
10. >> << >| |> A 197 KPK Knowledge
read from a file in C++?
Which function is used to
11. read ( ) get( ) put( ) write( ) C 197 KPK Knowledge
write to a file in C++?
It allows both
What is the purpose of It allows It treats the file
It allows reading reading and
12. ios::binary mode in file writing binary contents as C 195 KPK Knowledge
binary files only. writing binary
handling files only binary data.
files.
Which function is used to
13. check the end of a file in eof( ) end_of_file( ) is_end( ) file_end( ) A 201 KPK Knowledge
C++?
What is the purpose of the Sets the initial
Appends text at Opens a file in Reads a file
14. ios::ate mode in file position at the C 195 KPK Knowledge
the end of a file. append mode. from the end
handling? end of the file.
How do you read a single
readCharFrom
15. character from a file in readChar( ) get( ) read( ) B 205 KPK Knowledge
File( )
C++?
Opens a file at
What does the ios::app Opens a file in Opens a file in Opens a file in
16. the end A 195 KPK Knowledge
mode do in file handling? append mode. read mode. write mode.
position
Which function is used to
17. open( ) fopen( ) openfile( ) fstream( ) D 196 KPK Knowledge
open a file for both reading
APSACS PREP FOR ENTRY TESTS (PETS) PROGM - HSSC
School: APSAC FFC ATD Subject: Computer Science
and writing in C++?
What happens if we It displays a
It throws an It generates It create the
18. attempt to open the file that warning C 199 KPK Understanding
exception an error code new file
doesn’t exist? message
Which stream class is to
19. Ofstream Ifstream Fstream Iostream A 204 KPK Knowledge
only write on files
Returns true if Returns true if Returns true if Returns true if
file opening for file opening for file opening for file opening for
Which of these is correct
20. reading has reading has reading has reading has C 181 NBF Understanding
about eof() statement
reached the next reached the reached the reached the
character next word end middle
Which operator is used to
21. insert data into files in << >> < Both a & c A 196 KPK Understanding
C++?
Which operator is used to
22. << >> < > B 196 KPK Understanding
read data into file in C++?
When get()
The get() returns EOF End of file is When program
23. fails to read a Both A & B D 183 NBF understanding
when reached terminates
character
By default all the files are Sequential
24. Binary Mode Text Mode Both A & B B 194 KPK Understanding
opened in _______ mode . Mode
To open a file in To open a file To truncate an To truncate an
What is the use of ios::trunc
25. input mode in output existing file to existing file to D 176 NBF Understanding
mode?
mode half zero
APSACS PREP FOR ENTRY TESTS (PETS) PROGM - HSSC
School: APSAC FFC ATD Subject: Computer Science
C. ofstream
D. ostream