3i Infotech Papers: Sample Questions 150 - 151 of 1245

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

Question number: 150

» Basic CS » Operating System

Essay Question▾

Describe in Detail

What is SMP?

Explanation

Understanding of symmetric multiprocessor system.

Understanding of Symmetric Multiprocessor System.

Understanding of symmetric multiprocessor system.

  • SMP is a multi-processing system where multiple processors share common operating system and memory.

  • Processors also share disk input/output resources.

  • The processors also share memory and the I/O bus or data path.

  • OS manages scheduling on all the processors- combines power of multiple processors to complete a process.

  • Primarily used in resource intensive computing environments.

  • Multiple processors are transparent to the user

    • These processor share main memory and I/O facilities.

    • All processors can perform the same functions.

Advantages of SMP:

  • Performance:

    • Allows parallel processing

  • Availability:

    • Failure of a single processor does not stop computing.

  • Incremental growth:

    • Additional processors can be added.

Question number: 151

» Languages » C & C Plus Plus

MCQ▾

Question

What will the following program do?

  1. void main ()
  2. {
  3.     int i;
  4.     char a[] = “String”;
  5.     char * p = “New Sring”;
  6.     char * Temp;
  7.     Temp = a;
  8.     a = malloc (strlen (p) + 1);
  9.     strcpy (ap);//Line number: 9
  10.     //p = malloc (strlen (Temp) + 1);
  11.     strcpy (pTemp);
  12.     printf ( “(%s, %s)” ap);
  13.     free (p);
  14.     free (a);
  15. }
  16. //Line number 15//

Choices

Choice (4) Response

a.

Generate compilation error in line number 1

b.

Swap contents of p & a and print: (New string, string)

c.

Generate compilation error in line number 8

d.

Generate compilation error in line number 5

Answer

c.

Explanation

  • In the program

Table showing the program

Table showing the program

int i;

  • Define the integer i

char a [] = “String”;

  • Define the character array a [] = “String”

char * p = “New Sring”;

  • Define the character pointer p=”New String”

char * Temp;

  • Define the character pointer Temp

Temp = a;

  • Store the array value in pointer

a = malloc (strlen (p) + 1);

  • Statement tries to store the string length in pointer p in array “a”

  • But it is wrong, generating the error: assignment to expression with array type