#include "stdio.h"
#include "conio.h"
main()
{
int flag=0,flag1=0;
int s[10],d[10],sn,eop=1,dm,a[10][10];
int i,j,sum=0,min,x[10][10],k,fa,fb;
clrscr();
/* Getting The Input For the Problem*/
printf("Enter the number of Supply
");
scanf("%d",&sn);
printf("Enter the number of Demand
");
scanf("%d",&dm);
printf("Enter the Supply Values
");
for(i=0;i=d[j]) //Check the supply greater than equal to
demand
{
x[i][j]=a[i][j]*d[j]; // Calculate amount * demand
s[i]=s[i]-d[j]; // Calculate supply - demand
j++; // Increment j for the deletion of the row
or
column
}
}
/* The Cost Matrix is Estimated here */
printf("Given Cost Matrix is :
");
for(fa=0;fa
{
for(fb=0;fb
{
printf("%d ",a[fa][fb]);
}
printf("
");
}
/* The Allocated Cost Matrix is */
printf("Allocated Cost Matrix is
");
for(fa=0;fa
{
for(fb=0;fb
{
printf("%d ",x[fa][fb]);
sum=sum+x[fa][fb];
}
printf("
");
}
/* Transportation Cost Estimated and Sum is Printed*/
printf("The Transportation cost:%d
",sum);
getch();
}
#include "conio.h"
main()
{
int flag=0,flag1=0;
int s[10],d[10],sn,eop=1,dm,a[10][10];
int i,j,sum=0,min,x[10][10],k,fa,fb;
clrscr();
/* Getting The Input For the Problem*/
printf("Enter the number of Supply
");
scanf("%d",&sn);
printf("Enter the number of Demand
");
scanf("%d",&dm);
printf("Enter the Supply Values
");
for(i=0;i
No comments:
Post a Comment