Friday 26 July 2013

Chapter 2 solutions Problem [F][j]

Question-(j) 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.
Solution-
Here is it's solution.

#include<stdio.h>

int main()
{
int order,credit;

printf("Enter the order[more=0,less=1] and credit [ok=1,not ok=0]\n");
scanf("%d%d",&order,&credit);
if(credit==1&&order==1)
printf("supply his requirements\n");
 if(credit==0&&order==1)
printf("Please Credit more money\n");
if(credit==1&&order==0)
printf("Available Stock  and Remaining balance would be shipped ASAP\n");
return 0;
}  

3 comments: