Logical Analysis and Programming
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Remainder

5 posters

Go down

Remainder  Empty Remainder

Post by Admin 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 : 22658
Join date : 2015-06-24
Age : 29

https://csenpsb.board-directory.net

Back to top Go down

Remainder  Empty tricky interview ques

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

a. Rem=3.14%2.1

RukmaniB.E

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

Back to top Go down

Remainder  Empty Re: Remainder

Post by rapler 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 : 22612
Join date : 2015-06-24

Back to top Go down

Remainder  Empty Re: Remainder

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

C.rem=fmod(3.14,2.1);

Harish

Posts : 1
Points : 22604
Join date : 2015-06-25
Age : 29
Location : Chennai

Back to top Go down

Remainder  Empty Re: Remainder

Post by Admin 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 : 22658
Join date : 2015-06-24
Age : 29

https://csenpsb.board-directory.net

Back to top Go down

Remainder  Empty Re: Remainder

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

Answer D da ithuku

sreenivas_srevs

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

Back to top Go down

Remainder  Empty Re: Remainder

Post by Sponsored content


Sponsored content


Back to top Go down

Back to top


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