C ++ program only executes first “if” statement

scanf("%d",&amount);

You want to scan in as a float, not an integer, so you’ll want %f

Leave a Comment