fork download
  1. #include <stdio.h>
  2. int main()
  3. {
  4. float price, total;
  5. int quantity;
  6.  
  7. printf("Enter price per unit: ");
  8. scanf("%f", &price);
  9.  
  10. printf("Enter quantity: ");
  11. scanf("%d", &quantity);
  12. total = price * quantity;
  13. printf("Total amount to pay: %.2f\n", total);
  14.  
  15. getch();
  16. }
Success #stdin #stdout 0.02s 25924KB
stdin
Standard input is empty
stdout
#include <stdio.h>
int main()
 {
    float price, total;
    int quantity;

    printf("Enter price per unit: ");
    scanf("%f", &price);

    printf("Enter quantity: ");
    scanf("%d", &quantity);
    total = price * quantity;
    printf("Total amount to pay: %.2f\n", total);

    getch();
}