C - Operators - Discussion

You Are Here :: Home > C > Operators - Discussion

 



Q.

What will be output if you will compile and execute the following c code?

#include
int main(){
int a=-20;
int b=-3;
printf("%d",a%b);
return 0;
}

A. 2 B. -2
C. 18 D. -18

Answer: Option B
Explaination:

 


Sign of resultant of modular division depends upon only the sign of first operand



Discussion

Your Comments Goes here...
NameDiscussion