#include<stdio.h>
float discount(float p);
int main()
{
float p,total,q;
printf("\nEnter quantity=");
scanf("%d",&q);
printf("\nEnter price per item=";
scanf("%d",&p);
total=p*q-discount(p*q);
printf("\nTotal expanses=",total);
return 0;
}
float discount(float p)
{
if(p>=2000)
return p*0.10;
else
return 0;
}
float discount(float p);
int main()
{
float p,total,q;
printf("\nEnter quantity=");
scanf("%d",&q);
printf("\nEnter price per item=";
scanf("%d",&p);
total=p*q-discount(p*q);
printf("\nTotal expanses=",total);
return 0;
}
float discount(float p)
{
if(p>=2000)
return p*0.10;
else
return 0;
}
No comments:
Post a Comment