+ 2

Skee ball code problem

I just started with coding and i started to practice a little bit on this app, but it seems i cant do nothing that works. Here is my solution for skee ball code in c, and its not working, can somebody tell me why. And please give me advices what is best way to learn. https://code.sololearn.com/chqniovpx0Au/?ref=app

5th Nov 2021, 12:01 AM
Stee
3 Antworten
+ 3
You are very close. The only issue here is you are dividing points prior to taking input, so nothing meaningful gets divided. Instead, divide points after you've received input. int points; int gun; scanf("%d", &points); scanf("%d", &gun); points = points/12;
5th Nov 2021, 12:48 AM
Hatsy Rei
Hatsy Rei - avatar
+ 3
You are trying to use a variable with no declaration and no value: //int points = (points/12); bug int points; int gun; scanf("%d", &points); scanf("%d", &gun); points = points/12; //debug // or point /= 12;
5th Nov 2021, 12:52 AM
Solo
Solo - avatar
+ 3
Thank you guys, that was so easy and i lost almost hour on this. 😒 I will try harder and i hope i manage to think like programer... I choose C as my first language, what do you think is that good decision?
5th Nov 2021, 1:17 AM
Stee