Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main()
- {
- int numbers[13][13];
- printf("Input elements into the array:\n\n");
- for (int i = 0; i < 13; i++)
- {
- for (int j = 0; j < 13; j++)
- {
- scanf("%d", &numbers[i][j]);
- }
- printf("\n");
- }
- printf("\n\nPrinting the array:\n\n");
- for (int i = 0; i < 13; i++)
- {
- for (int j = 0; j < 13; j++)
- {
- printf("%d ", numbers[i][j]);
- }
- printf("\n");
- }
- printf("\n\n\nTransposing the array ....\n\n");
- for (int i = 0; i < 13; i++)
- {
- for (int j = i + 1; j < 13; j++)
- {
- numbers[i][j] += numbers[j][i];
- numbers[j][i] = numbers[i][j] - numbers[j][i];
- numbers[i][j] -= numbers[j][i];
- if (numbers[j][i] < 0)
- {
- numbers[j][i] = -numbers[j][i];
- }
- }
- }
- printf("\nPrinting the array:\n\n");
- for (int i = 0; i < 13; i++)
- {
- for (int j = 0; j < 13; j++)
- {
- printf("%d ", numbers[i][j]);
- }
- printf("\n");
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement