Wednesday, 13 August 2014

#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

2 comments:

  1. put the title to the post,
    i have one compilation error from your program, the 2D array 'a' is not defined, else its correct,
    4/5

    ReplyDelete

Note: only a member of this blog may post a comment.