3i Infotech Papers: Sample Questions 338 - 340 of 1245

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

Question number: 338

» Basic CS » Operating System

Short Answer Question▾

Write in Short

What are the rings in Windows NT?

Explanation

Ring window NT in image

Ring Window NT in Image

Ring window NT in image

  • Rings provides the separation between the user mode and kernel mode for different processes.

    • Kernel mode: (ring 0)

      • Executive run in protected memory mode with full privileges.

    • User mode: (ring 3)

      • Runs with privileges to access its own memory area.

      • User applications and environment subsystems execute in mode.

Question number: 339

» Languages » C & C Plus Plus

Essay Question▾

Describe in Detail

What is a protocol class?

Explanation

An abstract class is a protocol class:

  • Which neither contains nor inherits from classes that contain member data, non-virtual functions, or private (or protected) members of any kind.

  • With a non-inline virtual destructor defined with an empty implementation,

  • In which all member functions other than the destructor including inherited functions, are declared pure virtual functions and left undefined.

Image of the protocol class

Image of the Protocol Class

Given the image is instead of “protocol” think “base class with pure virtual functions. “

Question number: 340

» Languages » C & C Plus Plus

Essay Question▾

Describe in Detail

What is the output of the following program?

  1. main (int argcchar * * argv)
  2. {
  3.     printf (“enter the character” );
  4.     getchar();
  5.     sum (argv[1], argv[2]);
  6. }
  7. sum(num1num2)
  8. int num1num2;
  9. {
  10.     return num1 + num2;
  11. }

Explanation

In the program

Table shows the program

Table shows the program

main (int argc, char ** argv)

Define the main function with variable argc and character pointer to pointer argv

printf (“enter the character”);

Print ” enter the character”

getchar ();

getchar () gets a character from stdin.

This is equivalent to getc with stdin as its argument.

sum (argv [1], argv [2] );

argv [1] & argv [2] are string. They are passed to the function sum without converting it to integer values.

So, the compiler errors are generated.