+ 1
I did a small project plz test and review
3 Réponses
+ 2
Hello Harshal,
To get the remainder from division operation of floating point types we use a function named fmod() from <math.h> header.
http://www.cplusplus.com/reference/cmath/fmod/
Example:
// Include <math.h>
#include <math.h>
// Inside main() function
remain = fmod( dividend, divisor );
printf( "remainder is: %f\n", remain );
NOTE: For calculating remainder from division operation of integral types we use modulo operator `%`
P.S. Next time please state the problem clearly in post Description, here you didn't have such detail. People might misunderstood you were looking for votes or something cause the problem wasn't clearly described. Just a future reference ...
+ 3
Ipang Thanks for your valuable advice.
Let me tell you I'm new in programming as well as on sololrlearn
As per my little knowledge I tried this bcaz I don't know fmod() and math header
I will try to describe my question in right manner
Again Thanks
I hope you will keep helping and suggesting me🙏
+ 1
Small advice: make your indentation consistent. Whatever is inside "main", indent one level. Then more levels for blocks inside if, for, etc.
Doesn't change functionality. But improves readability - so, improves maintainability.