Languages-C & C Plus Plus [3i Infotech Placement]: Sample Questions 252 - 254 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 252

C & C Plus Plus
Edit

Describe in Detail

Essay▾

Write a program to find the factorial of a number.

Explanation

  1. #include<stdio.h>
  2. intmain()
  3. {
  4.     inti,f=1,num;
  5.     printf("Enter a number:");
  6.     scanf("%d",&num);
  7.     for(i=1;i<=num;i++)
  8.     f=fi;
  9.     printf("Factorial of %d is:%d",num,f);
  10.     return0;
  11. }

OUTPUT

Enter a number: 8

Factorial of 8 is:=

Question 253

C & C Plus Plus
Edit

Write in Short

Short Answer▾

Whether unified method and unified modeling language are same or different?

Explanation

  • Unified method is convergence of the Rumbaugh and Booch.
  • Unified modeling lang. is the fusion of Rumbaugh, Booch and Jacobson as well as Betrand Meyer (whose contribution is “sequence diagram” ) .
  • Unified modeling is superset of all the methodologies.
  • The UML is not intended to be a visual programming language however, the UML does have a tight mapping to a family of object oriented languages

Question 254

C & C Plus Plus
Edit

Write in Short

Short Answer▾

What is the binary equivalent of 52?

Explanation

For binary representation, only 0 and 1 two digits are used.

Here, for 8 bit representation, , , , , , , ,

So, to represent 52 we need

Placing 1 in these positions and 0 in rest of the positions, we will get 00110100.

So, binary equivalent of 52 will be 110100.

Developed by: