Posts

Array based Qs and answers

1) What is an array? Answer:- An array is a group of data of the same data type stored in successive storage locations. 2)How are elements of an array accessed? Answer:- Elements of an array are accessed using subscripts. 3)What is a subscript? Answer:- A subscript or an index is a positive integer value that identifies the storage position of an element in the array. 4)Which is the smallest subscript? Answer:- 0 (zero) 5)How many subscripts does a one and two dimensional array have? Answer:- one dimensional array has one subscript and a two dimensional array has two subscripts( row and a column subscript). 6)Write the syntax for declaring a one dimensional array. Answer:- syntax: datatype arrayname [size]; 7) Write the syntax for declaring a two dimensional array. Answer:- Syntax: datatype arrayname [row size] [column size]; 8) What do you mean by initializing an array? Answer:- Initializing of an array means storing data in to ...

Unix based Qs and ans

1. What are the events done by the Kernel after a process is being swapped out from the main memory? Answer :- 1.Kernel decrements the Reference Count of each region of the process. If the reference count becomes zero, swaps the region out of the main memory, 2.Kernel allocates the space for the swapping process in the swap device, 3.Kernel locks the other swapping process while the current swapping operation is going on, 4.The Kernel saves the swap address of the region in the region table. 2.Is the Process before and after the swap are the same? Give reason. Answer :- 1.Process before swapping is residing in the primary memory in its original form. The regions (text, data and stack) may not be occupied fully by the process, there may be few empty slots in any of the regions and while swapping Kernel do not bother about the empty slots while swapping the process out. 2.After swapping the process resides in the swap (secondary memory) device. The regions swapped out w...