I have the following simple piece of code:
double new_amount;
printf("Enter an amount: ");
scanf ("%d", &new_amount);
For some reason, it always give me zero as the new_amount no matter what I input.
What exactly am I doing wrong?
Also, is there a way I can do a little bit of error trapping in C like try-catch or maybe even just test whether the input IS numeric?