I have a problem with credit.c.

The program works when the user enter a numeric input but when someone enters a string, i don't know how to make that the program print "Number: " again. Instead of it the program print to the screen "Retry: " as a side effect of the function get_long_long() of the CS50.h


1 Answer 1


if you use get_long_long("Number: "); it will repeat that prompt if the user doesn't enter a number. if you use get_long_long(); it will print "Retry". check50 is assuming that you are using the first method.

You must log in to answer this question.

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