a) 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 item[25];
int department_code;
float regular_price, discount_price;
printf("Enter the name of item: "); scanf("%s", item);
printf("Enter the regular price of item: "); scanf("%f", ®ular_price);
printf("Enter the discount price of item: "); scanf("%f", &discount_price);
printf("Enter the department code: "); scanf("%d", &department_code);
printf("|=*=*=*=*=*=* receipt =*=*=*=*=*=*|");
printf("\nItem: %s", item);
printf("\nDepartment Code: %d", department_code);
printf("\nRegular price: %f$", regular_price);
printf("\nDiscount price: %f$", discount_price);
}
Comments
Leave a comment