Question:
What is a modulus operator? What are the restrictions of a modulus operator?
Answer:
A Modulus operator gives the remainder value. The result of x%y is obtained by (x-(x/y)*y). This operator is applied only to integral operands and cannot be applied to float or double. Source: CoolInterview.com
A Modulus Operator % return the Remainder of any Integer Division. It does't return any Float Value(Only the integer Value) Restrictions-This Operator can be operate with Integers only. Source: CoolInterview.com
Answered by: Ravi | Date: 2/25/2010
| Contact Ravi
If you have the better answer, then send it to us. We will display your answer after the approval.
Rules to Post Answers in CoolInterview.com:-
- There should not be any Spelling Mistakes.
- There should not be any Gramatical Errors.
- Answers must not contain any bad words.
- Answers should not be the repeat of same answer, already approved.
- Answer should be complete in itself.
|