3i Infotech Papers: Sample Questions 83 - 85 of 1245

Examrace Placement Series prepares you for the toughest placement exams to top companies.

Question number: 83

» Operating System » Unix

Short Answer Question▾

Write in Short

In what way the validity fault handler concludes?

Explanation

  • It sets the valid bit of the page by clearing the modify bit.

  • Maps the page to the memory

  • It recalculates the process priority.

Question number: 84

» Languages » C & C Plus Plus

Essay Question▾

Describe in Detail

Find the output of the following program

  1. class opOverload
  2. {
  3.     publicbool operator==(opOverload temp);
  4. };
  5. bool opOverload::operator==(opOverload temp)
  6. {
  7.     if(*this == temp )
  8.     {
  9.         cout<<"The both are same objects "return true;
  10.     else
  11.     {
  12.         cout<<"The both are different "return false;
  13.     }
  14. }
  15. void main()
  16. {
  17.     opOverload a1a2a1==a2;
  18. }

Explanation

  • In the program

Table showing the program

Table showing the program

  1. class opOverload
  2. {
  3.     publicbool operator==(opOverload temp);
  4. };
  • Define the class opOverload

  • Define the Boolean variable operator== (opOverload temp)

  1. bool opOverload::operator==(opOverload temp)
  2. {
  3.     if(*this == temp )
  4.     {
  5.         cout < < “The both are same objects ”; return true;
  6.     else
  7.     {
  8.         cout < < “The both are different ”; return false;
  9.     }
  10. }
  • Here operator functions can be called recursively

  • And check the if condition

  1. void main()
  2. {
  3.     opOverload a1a2a1==a2;
  4. }
  • This program just illustrates that point; calling the operator == function recursively, leading to an infinite loop.

Question number: 85

» Operating System » Unix

Essay Question▾

Describe in Detail

How are device represented in UNIX?

Explanation

  • Devices in UNIX are represented by files.

  • Each piece of hardware is a file.

  • Allows access to the hardware.

  • Device file is specified as ‘block special file’ with characteristics similar to a disk file.

  • Represents a device with characteristics similar to a keyboard.

Two types of devices are character devices and block devices.

ls-l/dev/zero

  • crw-rw-rw-1 root——/dev character device

ls-l/dev/sdal

  • brw-rw—-1 root –/dev/sdal block device

Two types of devices

Two Types of Devices

Two types of devices