Make a general store receipt of the customer who has bought several items. The Output should contain regular price of an item, the department code, and calculated the discount price. The receipt should be proper formatted using Escape sequence
#include <stdio.h>
#include <math.h>
int main() {
char itm[25];
int dpart_cd;
float rg_prc, discnt_prc;
printf("Enter the name of item: "); scanf("%s", itm);
printf("Enter the regular price of item: "); scanf("%f", &rg_prc);
printf("Enter the discount price of item: "); scanf("%f", &discnt_prc);
printf("Enter the department code: "); scanf("%d", &dpart_cd);
printf("|=*=*=*=*=*=* receipt =*=*=*=*=*=*|");
printf("\nItem: %s", itm);
printf("\nDepartment Code: %d", dpart_cd);
printf("\nRegular price: %f$", rg_prc);
printf("\nDiscount price: %f$", discnt_prc);
}
Comments
Leave a comment