Advertisement
Istanvir389

N * N Matrix : Problem C

Oct 8th, 2017
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. #include<stdio.h>
  2. int main()
  3. {
  4.  
  5. int i,j,k,n;
  6. printf("Enter number ::");
  7. scanf("%d",&n);
  8. int A[n][n];
  9. for(i=0;i<n;i++)
  10. {
  11. for(j=0;j<n;j++)
  12. {
  13. scanf("%d",&A[i][j]);
  14. }
  15. }
  16. for(i=0;i<=n-2;i++)
  17. {
  18. for(j=i;j<=i+1;j++)
  19. {
  20. for(k=0;k<n;k++)
  21. {
  22. printf("%d",A[j][k]);
  23. }
  24. printf("\n"); }
  25. printf("\n");
  26. }
  27. return 0;
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement