Friday, January 21, 2011

Operators and Expressions

In inventory management, the Economic Order Quantity for a single item is given by
EOQ = sqrt((2*demand rate * setup costs)/holding cost per item per unit time))
and the optional Time Between Orders
TBO = sqrt((2*setup costs)/(demand rate*holding cost per item per unit time))
Write a program to compute EOQ and TBO, given demand rate (item per unit time), setup costs (per order),
and the holding cost (per item per unit time).
#include<stdio.h>
#include<math.h>
void main()
{
float EOQ, d_r, s_c, h_c, TBO;
printf("Enter Demand rate, Setup costs and Holding costs\n");
scanf("%f %f %f",&d_r,&s_c,&h_c);
EOQ = sqrt((2*d_r*s_c)/h_c);
TBO = sqrt((2*s_c)/(d_r*h_c));
printf("TOQ = %8.2f\nTBO = %8.2f",EOQ,TBO);
getch();
}

No comments:

Post a Comment