-
Notifications
You must be signed in to change notification settings - Fork 37
solution to 4-19 #4
Copy link
Copy link
Open
Description
i suggest you add this solution
to 4-19
`#include <stdio.h>
include <stdlib.h>
int main()
{
int product_number,quntity;
int total_quntity=0,i;
float retial_price,total_retial=0;
for(i=0;i<7;i++)
{
printf("Enter product No.: ");
scanf("%i", &product_number);
printf("enter quantity sold : ");
scanf("%d", &quntity);
total_quntity+= quntity;
switch (product_number)
{ case 1:
retial_price= 2.98_quntity;
break;
case 2:
retial_price= 4.50_quntity;
break;
case 3:
retial_price= 9.98_quntity;
case 4:
retial_price= 4.94_quntity;
break;
case 5:
retial_price= 6.87*quntity;
break;
}
total_retial+= retial_price;
}
printf("retial price is %f\n",total_retial);
printf("total quantity is %d",total_quntity);
return 0;
}`
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels