3i Infotech Placement: Sample Questions 270 - 272 of 1245

Glide to success with Doorsteptutor material for competitive exams : get questions, notes, tests, video lectures and more- for all subjects of your exam.

Question 270

Edit

Write in Short

Short Answer▾

What is the functionality of the stub?

Explanation

  • Stub functions are defined but have no real code in them.
  • For example
  1. stringprintMessage()
  2. {
  3.     return “”;
  4. }

This function does nothing but returns an empty string.

They are also called “skeleton functions” .

Question 271

Edit

Describe in Detail

Essay▾

Write a program to compare two strings without using the strcmp () function.

Explanation

  1. #include<stdio.h>
  2. intmain()
  3. {
  4.     charstr1 [20], str[20]
  5.     inti=, c=0;
  6.     print(“enterfirststring ::”);
  7.     gets(str1);
  8.     printf(“entersecondstring::”);
  9.     gets(str2);
  10.     printf(“stringsare :: ”);
  11.     puts(str1);
  12.     puts(str2);
  13.     while((str1[i]!=’⧵0’) || (str2[i0!=’⧵0’))
  14.     {
  15.         if (str1[i]!=str2 [i])
  16.         c++;
  17.         i++;
  18.     }
  19.     if(c==0)
  20.     puts(“⧵stringsareequal.”);
  21.     else
  22.     puts(“stringsarenotequal.”);
  23.     return0;
  24. }

OUTPUT

Enter first string:: Abcdef

Enter second string:: ABCDEF

String are::

Abcdef

ABCDEF

These strings are not equal.

Process returned 0.

Question 272

Edit

Write in Short

Short Answer▾

When does the condition ‘rendezvous’ arise?

Explanation

  • In OS rendezvous condition is related to message passing.
  • Rendezvous is a condition when receiver and sender are blocked until message is delivered
  • Sender is blocked upon sending and receiver is blocked waiting for message.
  • Thus, both sender and receiver are blocked and message is passed from sender to receiver.

Developed by: