[Updated] Goldman Sachs Aptitude Test Questions and Answers
Practice List of TCS Digital Coding Questions !!!
Take 50+ FREE!! Online Data Interpretation Mock test to crack any Exams.

C Programming :: Floating Point Problems - Discussion

Home > C Programming > Floating Point Problems > MCQs Questions Discussion

4 / 6

Choose the correct option.

If a = -11 and b = -3 what is the value of a%b?

A-3

B3

C2

D-2

Answer: Option (Login/Signup)

Show Explanation

C define % operator operation for a%b as below:

a = (a/b) * b + a%b

Here dividend is negative so the answer will be -2

Important Points:

=> The answer will be -2 in the scenario where a = -11 and b = 3

=> The answer will be 2 in the scenario when a = 11 and b = -3 or 3



Asked In ::

Post Your Answer Here:     

Reply    
Rate This: +0 -0
    Report


Report Error

Please Login First Click Here