What is a modulus operator?

What is a modulus operator?

it gives reminder of any division operation

By:pranav
Date:2028-11-08 00:00:00

It is an binary arithmetic operator which returns the remainder of division operation. It can used in both floating-point values and integer values. 

Use of the modulus operator is given below:

opLeft % opRight

where, opLeft is the left operand and opRight is the right operand. This expression is equivalent to the expression opLeft - ((int) (opLeft / opRight) * opRight)

By:Vivek Kr. Agarwal
Date:2029-12-08 00:00:00

in c language it is used to determine the remainder of any no by deviding the operator if  both of them is not float no.

By:sanjay gupta
Date:2004-10-09 00:00:00

it gives remainder part of divisoneg. printf("%d",5%2) output 1

By:shaina
Date:2004-11-09 00:00:00

Post Your Answers


User Email:

User Name:
Answers:

Related C Subjective Links

C Subjective interview questions and answers for experienced and fresher