What's New-Given Below
technicalsymposium
technicalsymposium
technicalsymposium

C/C++ Lab Program(s)/Materials

Technicalsymposium.com-Receive Latest Updates through Facebook-Like us Below

C Program for salesman problem.

#include<stdio.h>
#include<conio.h>
void main()
{
int ss[50][50]={0};
int x,y,sale,i,a,b,t=0;
clrscr();
printf("\nEnter the How many sales man:");
scanf("%d",&sale);
printf("\nEnter the How many Items:");
scanf("%d",&i);
for(a=0;a<sale;a++)
{
for(b=0;b<i;b++)
{
printf("Sales man [%d] item [%d]:",a+1,b+1);
scanf("%d",&ss[a][b]);
}
}
clrscr();
printf("\n**********************************************************");
printf("\n*********************SALES REPORT*************************");
printf("\n**********************************************************\n");
printf("\n\t\t");
for(b=0;b<i;b++)
{
printf("item[%d] ",b+1);
}
printf(" Total");
for(a=0;a<sale;a++)
{
printf("\nSales man [%d]",a+1);
for(b=0;b<i;b++)
{
printf(" %d\t",ss[a][b]);
t+=ss[a][b];
}
printf(" %d",t);
t=0;
}
printf("\n********************************************************\n");
printf("TOTAL :");
printf("\t\t");
x=0,y=0;
for(a=0;a<i;a++)
{
for(b=0;b<sale;b++)
{
x=x+ss[b][a];
}
y=y+x;
printf(" %d\t",x);
x=0;
}
printf(" %d\t",y);
printf("\n********************************************************");
getch();
}

More Lab Programs with Answers -Given Below-Click and Get Freely

Hosting by Yahoo!

About-Us    Contact-Us    Site-map

©copyright 2009 All rights are reserved to technicalsymposium.com