Saturday, January 30, 2010

CHAP 2[F]j Checking customers order

The policy followed by a company to process customer orders is given by the following rules:
(a) If a customer order is less than or equal to that in stock and has credit is OK, supply has requirement.
(b) If has credit is not OK do not supply. Send him intimation.
(c) If has credit is Ok but the item in stock is less than has order, supply what is in stock. Intimate to him data the balance will be shipped.
Write a C program to implement the company policy.



void main()
{
int order,stock,credit;
printf("\nInput order,stock,credit(1 or0)");
scanf("%d%d%d",&order,&stock,&credit);

if(credit==1)
{
if(order<=stock)
printf("\nSupply");

else
printf("\nNot Enough");
}

else
printf("\nCredit not ok");
}

No comments:

Post a Comment