Skip to content

solution to 4-19 #4

@mai95

Description

@mai95

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;

}`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions