Crash#2 (2ND Year) Comp-2024

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

PAK-TURK MAARIF INTERNATIONAL SCHOOLS & COLLEGES H-8/1

Name: ____________________ Class: HSCC-II


Subject: Computer Time: 80 MIN
Session 2023-24
Total Marks: 40
Crash Test: #2(Chapter 1 &Chapter 6)
Section-A(7)
Q1: Choose the correct answer from the following
1. In which state, a process is waiting to be assigned to the processor by the operating system scheduler?

A. New state C. Waiting


D. Running
B. Ready

2. Which one of the following types of processing has grouped transactions, executed in a sequence?
A. Real time C. Time sharing

B. Batch D. Distributed
3. By default, argument in C++ are:
A. Pass by constant B. Pass by reference
C. Pass by value D. Pass by character
4. When function is overloaded which type will not consider.
A. Return type B. Data type
C. Parameters D. Default argument
5. Suppose that a process is in blocked state waiting for some I/O service. When the service is
completed, it goes to the:
A. Running state C. Suspended state
B. Ready state D. Terminated state

6. A function that always represents a positive integer is


A. cos() C. pow( )
B. sqrt() D. abs()
7. What will be the output of following code:?
#include <iostream.h>
void square (int *x, int *y)
{
*x = (*x) * --(*y);
}
int main ( ) {
int number = 30;
square(&number, &number);
cout << number;
return 0;
}
A. 30 C. Error
B. 870 D. Segmentation on fault
SECTION-B(8*3=24)
Q2: Answer the following questions:
i. Define real time operating and embedded operating system, and also write
example of each where they are using.
ii. What is swap-in and swap-out?
iii. Write a program in C++ to find the product of two numbers using user-define
function
iv. Differentiate between local and global scope, define with example.
v. What will be the output of the following?
main() {
int i = 45, c ;
c = multiply ( i * 1000 ) ;
cout<< c <<endl ;
}
check ( int ch )
{ if ( ch >= 40000 )
return ( ch / 10 ) ;
else
return ( 10 ) ;
}
vi. What is inline function? Explain it with proper code
vii. Write a program with a function mean () that inputs three integers and finds the
arithmetic mean.
viii. Is MS-DOS faster than Windows? If yes, then explain why with valid reasons in
your answer.

SECTION –C(5*2=10)
Q3: Answer the following questions
I. (a) Explain function overloading in detail and also demonstrate it with proper C+
+ code.
(b) Explain the "Blocked" state in the context of process management. What kind of
events can cause a process to move into this state, and what needs to happen for it to
transition back to the "Ready" state?
II. Write a program that inputs marks in main function and passes these marks to a
function. The function finds grade of students on the basis of the following
criteria:

The function returns grade back to main function where it is displayed on the screen.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy