Someone Help me with this code!! (Closed)
/*What I want the code to do is calculate the net-total of all gifts brought and then take the Total as an Input to automatically apply 15 percent discount in it, now algebraically-adding all the gifts work fine but It just shows the discounted total price as 0 why ? (sorry for the bad english) */ #include <stdio.h> int main () { float gift1, gift2, gift3, total, discount; // Defines the Variables to hold. printf("How much do you want to spend on your dad?"); scanf ("%f", &gift1); printf("How much do you want to spend on your mom?"); scanf("%f", &gift2); printf("How much do you want to spend on your brother?"); scanf("%f", &gift3); total = gift1+gift2+gift3; // Calculates the algebraic addition to get the the total value. printf ("\n Total of all that would be %.f", total); scanf("%.f", &total); // Gets the "total" value for input. total = 0.85 * discount; // Getting a 15% discount in total value. printf("\n If you get a discount of 15 percent on that you would still "); printf("have to pay %.f", total); return 0; }