0

Can someone help please? I don't know where i went wrong.

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

8th Jan 2018, 9:40 PM
Rahni Sihem
Rahni Sihem - avatar
10 Antworten
+ 9
various mis-capitalisation, printf format incorrect in last two usages, missing ; , missing #include <math.h>, also void main() instead of int main()
8th Jan 2018, 9:54 PM
jay
jay - avatar
+ 8
@john, not my code :) But yes, this is c. Feel free to continue improvements for Park :) There maybe other errors I did not pick up on
8th Jan 2018, 10:06 PM
jay
jay - avatar
+ 2
Based on coding style I'm guessing you want C not C++. Otherwise, you shouldn't use .h includes as C++ doesn't use them anymore.
8th Jan 2018, 10:03 PM
John Wells
John Wells - avatar
+ 2
Our teacher wrote this code and she insisted that everything is correct and it'd work if we wrote it like that using C++. Thank you all for ur help. ^^
12th Jan 2018, 8:59 PM
Rahni Sihem
Rahni Sihem - avatar
+ 1
My C code runs. Must enter 5. for float scanf to work. https://code.sololearn.com/c3W9zCLMGGqA/
8th Jan 2018, 10:32 PM
John Wells
John Wells - avatar
+ 1
Oh okay, thanks a lot!! I wasn't interested in this coding thing tbh if it wasn't for my studies, but it's really interesting! I'll keep learning with this app and i hope u'll help me more in the future 😁 thanks again! 😃
12th Jan 2018, 10:09 PM
Rahni Sihem
Rahni Sihem - avatar
0
@jay you're reading floats (%f) in ints (int a,b,c).
8th Jan 2018, 10:00 PM
John Wells
John Wells - avatar
0
If you want to have an actual two way conversation, please join us here. I have a few people I teach or help with their projects via DM (direct message.) https://www.sololearn.com/Discuss/689391/?ref=app
12th Jan 2018, 10:59 PM
John Wells
John Wells - avatar
- 1
Either she or you made a mistake. scanf %f is a format for floating point input and your variables were integers. Depending on which compiler it might run, but you won't get the values you expected as 32 bit integers aren't stored anything like 32 bit floats. The capitalization might have been automatically done as you inputted the lines. My phone does it to me.
12th Jan 2018, 10:06 PM
John Wells
John Wells - avatar