#include<stdio.h>
#include<conio.h>
void main()
{
int
a[10][10],i,j,sum=0,size=3;
printf(“Enter the
elements of the matrix\n”);
for(i=0;i<size;++i)
{
for(j=0;j<size;++j)
{
scanf(“%d”,&a[i][j]);
if(i<j)
sum=sum+a[i][j];
}
}
printf(“Sum of
element of upper triangle is : %d”,sum);
getch();
}
OUTPUT :
Enter the element of the matrix
1
2
3
4
5
6
7
8
9
Sum of element of upper triangle is : 11
0 comments:
Post a Comment