SALES REPORT - Using Two Dimentional Array
#include “conio.h”
#include”stdio.h”
void main()
{
int a[20][20],i,j,b,n,m;
clrscr();
printf("\n\n\t\t\tSALES REPORT");
printf("\n\t\t\t************\n");
printf("\nEnter the no.of Salesgirl : ");
scanf("%d",&n);
printf("\nEnter the no.of Items : ");
scanf("%d",&m);
printf("\nEnter the items ");
for(i=0;i
{
for(j=0;j
{
scanf("%d",&a[i][j]);
}
}
for(i=0;i
{
b=0;
for(j=0;j
{
b=a[i][j]+b;
}
a[i][j]=b;
}
for(j=0;j
{
b=0;
for(i=0;i
{
b=a[i][j]+b;
}
a[i][j]=b;
}
b=0;
for(i=0;i
{
b=a[i][m]+b;
}
a[n][m]=b;
printf("\n\tSALES GIRL");
for(i=0;i
{
printf("\tITEM %d",i+1);
}
printf("\tTOTAL");
for(i=0;i<=n;i++)
{
if(i
printf("\n\t\t%d",i+1);
else
printf("\n\t\tTOTAL");
for(j=0;j<=m;j++)
{
printf("\t %d",a[i][j]);
}
}
getch();
}
No comments:
Post a Comment