3i Infotech Placement: Sample Questions 526 - 527 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 526

Question

MCQ▾

If a boat is moving in upstream with velocity of 14 km/hr and goes downstream with a velocity of 40 km/hr, then what is the speed of the stream?

Choices

Choice (4)

a.

34 km/hr

b.

13 km/hr

c.

26 km/hr

d.

None of the above

Answer

b.

Explanation

Boat is moving in upstream with velocity of 14 kmph and downstream with a velocity of 40 kmph.

Upstream speed, b = 14 kmph

Downstream speed, a = 40 kmph

We are asked to find the speed of stream.

Speed of stream will be,

= 13 kmph

So, speed of stream is 13 kmph.

Question 527

Edit

Describe in Detail

Essay▾
  1. voidmain ()
  2. {
  3.     unsignedi =1;
  4.     /⚹unsigned char k =-1 ➾ k =255; ⚹/
  5.     signedj =-1;
  6.     /⚹char k =-1 ➾ k =65535 ⚹/
  7.     /⚹unsigned or signed int k =-1 ➾ k =65535 ⚹/
  8.     if (i<j)
  9.     printf("less");
  10.     elseif (i>j)
  11.     printf ("greater");
  12.     elseif (i==j)
  13.     printf ("equal");
  14. }

Explanation

  • Program defines signed and unsigned values
Table Showing the Program
unsigned i = 1;
  • define the unsigned variable i = 1
signed j =-1;
  • define the signed variable j =-1
if (i < j)

printf ( “less” ) ;

else if (i > j)

printf ( “greater” ) ;

else if (i == j)

printf ( “equal” ) ;

}

  • check the if condition

    if (1 <-1)

    printf ( “less” ) ;

  • printf prints “less” because unsigned can hold a larger positive value, and no negative value.
  • Signed integers can hold both positive and negative numbers.
  • Unsigned uses the leading bit as a part of the value, while the signed version uses the left-most-bit to identify if the number is positive or negative.

Developed by: