#include<stdio.h>
#include<conio.h>
void main()
{int cs,rs,i,j,a[2][4];
printf("enter 8 value");
for(i=0;i<=1;i++)
{for (j=0;j<=3;j++)
scanf("%d",&a[i][j]);
}
printf("entered value are \n");
for(i=0;i<=1;i++)
{for(j=0;j<=3;j++)
printf("\t%d",a[i][j]);
printf("\n");
}
for(i=0;i<=1;i++)
{rs=0;
for(j=0;j<=3;j++)
rs+=a[i][j];
printf(" \nsum of row %d is %d",i+1,rs);
}
for(j=0;j<=3;j++)
{ cs=0;
for(i=0;i<=1;i++)
cs+=a[i][j];
printf("\nsum of cloumn %d is %d",j+1,cs);}
getch();
}
#include<conio.h>
void main()
{int cs,rs,i,j,a[2][4];
printf("enter 8 value");
for(i=0;i<=1;i++)
{for (j=0;j<=3;j++)
scanf("%d",&a[i][j]);
}
printf("entered value are \n");
for(i=0;i<=1;i++)
{for(j=0;j<=3;j++)
printf("\t%d",a[i][j]);
printf("\n");
}
for(i=0;i<=1;i++)
{rs=0;
for(j=0;j<=3;j++)
rs+=a[i][j];
printf(" \nsum of row %d is %d",i+1,rs);
}
for(j=0;j<=3;j++)
{ cs=0;
for(i=0;i<=1;i++)
cs+=a[i][j];
printf("\nsum of cloumn %d is %d",j+1,cs);}
getch();
}
No comments:
Post a Comment