+ 1

I did a small project plz test and review

https://code.sololearn.com/c4LMJf0DInCQ/?ref=app

29th May 2022, 10:14 PM
Harshal Madgulkar
Harshal Madgulkar - avatar
3 Respuestas
+ 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 ...
30th May 2022, 12:35 AM
Ipang
+ 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🙏
30th May 2022, 12:50 AM
Harshal Madgulkar
Harshal Madgulkar - avatar
+ 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.
30th May 2022, 2:46 AM
Emerson Prado
Emerson Prado - avatar