Output errors of the check50 test gives me an interesting output:

:( input of 0.41 yields output of 4 \ expected output, but not "4"

And it does this for all the testing numbers. Since the output "looks" correct, my only possible explanation is that I didn't round my number correctly and I am actually outputing a number but possible a float behind it that doesnt show up. ie- 4.xxxx

Looking at my code, and explanations I have read on this forum, it seems right. I got my float input, converted to integer while rounding and * 100. So, maybe this isnt the problem.

Could it be the final printf of the number? I did a simple printf("%d", a); // a being my coin counter.

1 Answer 1


I figured it out. Believe it or not, all I needed to do was supply a \n in my printf. geez.

  • i got the same error but i already have the \n in my printf function. this is the error i get : :( input of 0.41 yields output of 4 \ expected output, but not "4 \n" what does your printf function look like? mines like this : printf("%d \n", coins); Commented Aug 4, 2016 at 14:30
  • i also figured it out, you dont require a space between your placeholder and \n. Commented Aug 4, 2016 at 14:39

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .