Wednesday, 13 August 2014

 #include<stdio.h>
 #include<conio.h>
 int main()
 {
 int a,b,size;
 int array[10][10];
 printf("enter size of the array:");
 scanf("%d", &size);
 printf("\n Enter the array elements:");
 for(a=0;a<size;a++)
 {
 for(b=0;b<size;j++)
 {
 scanf("%d",&array[a][b]);
 }
 }   
 printf("\n Matrix:\n");
 for(a=0;a<size;a++)
 {
 for(b=0;b<size;b++)
 {
 printf("%d  ", array[a][b]);
 }
 printf("\n");
 }
 for(a=0;a<size;a++)
 {
 for(b=0;b<size;b++)
 {
 if((a+b)<=(size-1)
 {
 printf("%d", array[a][b]);
 }
 printf("");
 } 
 printf("\n");
 }
 getch();
 return 0;            
 }                         
 

2 comments:

  1. Write the post title, and compile the program once its having some errors...!!!

    ReplyDelete

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