Chapter - 3: The Decision Control

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


G
Sections
8
Exercises

A

B

C

D

E

F

G

H

I

J

K

1

2

3

4

5

6

7

8

9

10

11

13

#include<stdio.h>
#include<conio.h>
int main()
{
	int stk,odr,crdt;
	
	printf("Hello!!\nThe price of our item is 100Rs. per item.\n ");
	
	printf("\nEnter the stock company have : ");
	scanf("%d", &stk);
	
	printf("\nEnter the quantity ordered : ");
	scanf("%d", &odr);
	
	printf("\nEnter the credit done by customer : ");
	scanf("%d", &crdt);
	
	if(stk>=odr && crdt>=(100*odr))
		printf("\n\nYour order has been placed successfully and will be delivered to you shortly.");
	
	if(stk>=odr && crdt<(100*odr))
		printf("\nYour payment done is not sufficient for your ordered items.\nTry again!!");
		
	if(stk<odr && crdt>=(100*odr))
		printf("\n\nWe have not sufficient items, but they will delivered to you shortly.");
	
	getch();
	return 0;
}

© 2020 Garbage Valuegarbage value logo