Remainder

View previous topic View next topic Go down

Remainder

Post by Admin on Mon Jun 29, 2015 10:27 pm

Which of the following statements should be used to obtain a remainder after dividing 3.14 by 2.1 ?

A. rem = 3.14 % 2.1;
B. rem = modf(3.14, 2.1);
C. rem = fmod(3.14, 2.1);
D. Remainder cannot be obtain in floating point division.

Admin
Admin

Posts : 22
Points : 5823
Join date : 2015-06-24
Age : 23

http://csenpsb.createforum.in

Back to top Go down

tricky interview ques

Post by RukmaniB.E on Tue Jun 30, 2015 10:54 pm

a. Rem=3.14%2.1

RukmaniB.E

Posts : 1
Points : 5762
Join date : 2015-06-26

Back to top Go down

Re: Remainder

Post by rapler on Tue Jun 30, 2015 11:44 pm

Nope not the right answer Rukmani, jus think where you'll get a remainder.. You think of it and you'll get the answer..

rapler

Posts : 2
Points : 5777
Join date : 2015-06-24

Back to top Go down

Re: Remainder

Post by Harish on Thu Jul 02, 2015 6:14 am

C.rem=fmod(3.14,2.1);

Harish

Posts : 1
Points : 5769
Join date : 2015-06-25
Age : 22
Location : Chennai

Back to top Go down

Re: Remainder

Post by Admin on Thu Jul 02, 2015 10:04 pm

Harish wrote:C.rem=fmod(3.14,2.1);

Nope not the right answer buddy!!! you can use % only for whole numbers and not for fractions or rational numbers.. So option D is correct.. Anyways nice try..

Admin
Admin

Posts : 22
Points : 5823
Join date : 2015-06-24
Age : 23

http://csenpsb.createforum.in

Back to top Go down

Re: Remainder

Post by sreenivas_srevs on Sat Jul 04, 2015 7:19 pm

Answer D da ithuku

sreenivas_srevs

Posts : 3
Points : 5764
Join date : 2015-06-26

Back to top Go down

Re: Remainder

Post by Sponsored content


Sponsored content


Back to top Go down

View previous topic View next topic Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum