chtp icon indicating copy to clipboard operation
chtp copied to clipboard

solution to 4-19

Open mai95 opened this issue 8 years ago • 1 comments

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;

}`

mai95 avatar Aug 20 '16 16:08 mai95

hi, thank you.

I'm a little busy now. I'll give it a check asap

lbraglia avatar Aug 23 '16 07:08 lbraglia