fork download
  1. #include <stdio.h>
  2. main()
  3. {
  4. int Code;
  5. char Name[10];
  6. float Summit,Tax,Netpay;
  7. printf("\tReport Netpay\n");
  8. printf("***************************************************************\n");
  9. printf("\tCode: ");
  10. scanf("%d", &Code);
  11. printf("\tName: ");
  12. scanf("%s", &Name);
  13. printf("\tSummit: ");
  14. scanf("%f", &Summit);
  15. printf("***************************************************************\n");
  16.  
  17. if (Summit>30000)
  18. Tax = Summit * 0.05;
  19. else if (Summit>20000)
  20. Tax = Summit * 0.03;
  21. else if (Summit>10000)
  22. Tax = Summit * 0.01;
  23. else
  24. Tax = Summit;
  25.  
  26. printf("***************************************************************\n");
  27. Netpay=Summit-Tax;
  28. printf("\t*Tax = %.2f\n",Tax);
  29. printf("\t*Netpay = %.2f \n",Netpay);
  30. }
  31.  
Success #stdin #stdout 0s 5276KB
stdin
Standard input is empty
stdout
	Report Netpay
***************************************************************
	Code: 	Name: 	Summit: ***************************************************************
***************************************************************
	*Tax = -0.00
	*Netpay = 0.00