#include <stdio.h>

int main() {
    int ara[3][3];
    int i, j, k=100;

    for (i=0; i<3;  i++)
        for (j=0; j<3; j++)
            ara[i][j]=k++;

    for (i=0; i<3;  i++) {
        for (j=0; j<3; j++) {
            int temp=ara[i][j];
            ara[i][j]=ara[j][i];
            ara[j][i]=temp;
        }
    }

    for (i=0; i<3;  i++) {
        for (j=0; j<3; j++) {
            printf("%d\t", ara[i][j]);
        }
        printf("\n");
    }
}

asked 18 Aug, 22:00

Aryan_robin's gravatar image

Aryan_robin
112

edited 18 Aug, 22:28

Mosharraf%20Hosain's gravatar image

Mosharraf Hosain ♦
48618

Be the first one to answer this question!
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×390
×88

question asked: 18 Aug, 22:00

question was seen: 55 times

last updated: 18 Aug, 22:28