#include<stdio.h>
#include<conio.h>
main()
{
int i,j,n,arr[10][10];
printf("\n Enter the size of the array:");
scanf("%d",&n);
printf("\n Enter the elements:");
for(i=0;i<n;i++)
{
for(j=0;j<n;j++)
{
scanf("%d",&a[i][j]);
}
}
printf("\n The lower left matrix is as follows:\n ");
for(i=0;i<n;i++)
{
for(j=0;j<=i;j++)
{
printf("\t%d",a[i][j]);
}
printf(" \n");
}
getch();
return 0;
}
output................lower left matrix
1
4 5
7 8 9
#include<conio.h>
main()
{
int i,j,n,arr[10][10];
printf("\n Enter the size of the array:");
scanf("%d",&n);
printf("\n Enter the elements:");
for(i=0;i<n;i++)
{
for(j=0;j<n;j++)
{
scanf("%d",&a[i][j]);
}
}
printf("\n The lower left matrix is as follows:\n ");
for(i=0;i<n;i++)
{
for(j=0;j<=i;j++)
{
printf("\t%d",a[i][j]);
}
printf(" \n");
}
getch();
return 0;
}
output................lower left matrix
1
4 5
7 8 9
put the title to the post,
ReplyDeletei have one compilation error from your program, the 2D array 'a' is not defined, else its correct,
4/5
arr[] or a[]...?????
ReplyDelete