google.com, pub-4617457846989927, DIRECT, f08c47fec0942fa0 Learn to enjoy every minute of your life.Only I can change my life.: Write the c program to calculate the sum of element of lower triangle of nXn matrix

Saturday, February 6, 2016

Write the c program to calculate the sum of element of lower triangle of nXn matrix

//Write the c program to calculate the sum of element of lower triangle of //nXn matrix
#include<stdio.h>
#include<conio.h>
void main()
{
int a[10][10],r,c;
int i=0,j=0,sum=0;
clrscr();
printf("\n enter the r and c");
scanf("%d%d",&r,&c);
printf("\n enter the array\n");
for(i=0;i<r;i++)
{
for(j=0;j<c;j++)
{
scanf("%d",&a[i][j]);
}
}
printf("\n enter the array\n");
for(i=0;i<r;i++)
{
for(j=0;j<c;j++)
{
printf("\t%d",a[i][j]);
}
printf("\n");
}
printf("\n sum of lower triangle\n");
for(i=0;i<r;i++)
{
for(j=0;j<c;j++)
{
if(i>=j)
sum=sum+a[i][j];
}
}
printf("\n sum of lower tringle=%d",sum);
getch();
}

रामायण

रामायण दशरथ की तीन पत्नियाँ – कौशल्या, सुमित्रा , कैकेयी दशरथ के चार पुत्र – राम,लक्ष्मण,भरत,शत्रुघ्न दशरथ: राम के पिता और कौशल के राजा कौशल...