void main()
{
int i,quantity[5];
float rate[5],value,totalvalue;
char code[5][5];
clrscr();
i=1;
while(i <= ITEMS)
{
printf("Enter code,quantity, and rate : ");
scanf("%s %d %f",code[i],&quantity[i],&rate[i]);
i++;
}
printf("\n\n");
printf(" INVENTORY REPORT \n");
printf("---------------------------------------------------\n");
printf("Code Quantity Rate Vlaue \n");
printf("---------------------------------------------------\n");
totalvalue =0;
i=1;
while(i <= ITEMS)
{
value=quantity[i] * rate[i];
printf("%5s %10d %10.2f %e\n",code[i],quantity[i],rate[i],value);
totalvalue +=value;
i++;
}
printf("--------------------------------------------------\n");
printf(" Total Value = %e\n",totalvalue);
printf("--------------------------------------------------\n");
getch();
}