Programming | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Programming

Can is it possible to have modulus of integer by double...means as following experssion is valid or not in C++???? Int x:10; Int y:7; Double z:4.5; (x+y)%z

2nd Nov 2019, 7:46 AM
Zainab Fatima
Zainab Fatima - avatar
6 Answers
+ 7
BTW the way you have defined the variables is not the C++ way.
2nd Nov 2019, 8:17 AM
Sonic
Sonic - avatar
+ 5
You can also try it on code playground to find out.
2nd Nov 2019, 8:16 AM
Sonic
Sonic - avatar
+ 3
Sonic i know its not the C++ way.....i just ask a simple ques about that
2nd Nov 2019, 8:34 AM
Zainab Fatima
Zainab Fatima - avatar
+ 3
Zainab Fatima that's OK then.
2nd Nov 2019, 8:43 AM
Sonic
Sonic - avatar
+ 2
~ swim ~ thanks
2nd Nov 2019, 8:19 AM
Zainab Fatima
Zainab Fatima - avatar
0
Yes, you can Just write above expression as ((10+7)*10)/45
2nd Nov 2019, 9:37 PM
Danish