Languages-C & C Plus Plus [3i Infotech Placement]: Sample Questions 79 - 80 of 354

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

Question 79

C & C Plus Plus
Edit

Write in Short

Short Answer▾

Who were the three famous amigos and their contribution to the object community?

Explanation

  • The Three amigos namely,
    • James Rumbaugh (OMT) : A veteran analysis with an idea about the objects and their Relationships (Associations) .
    • Grady Booch: A design veteran with the idea about partitioning of systems into subsystems.
    • Ivar Jacobson (Objectory) : The father of USECASES, describing the user and system interaction.

Question 80

C & C Plus Plus
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.

Developed by: