Trace and Normal


Submit solution

Points: 10 (partial)
Time limit: 2.0s
Memory limit: 12M

Authors:
Problem type
Allowed languages
C

Task

To find the trace and normal of a matrix.

Input

Read the size of matrix in a line separated by space followed by array elements separated by space in the next line.

Output

Display the result in the new line.

Sample Input1

3 4

Sample output1

Not a square matrix

Sample Input2

2 2

1 1 1 1

Sample output2

Trace is 2 and normal is 2


Comments


  • 1
    pradeepkumar1817  commented on May 10, 2023, 4:24 p.m.

    include<stdio.h>

    int main(){ int a,b; scanf("%d %d",&a,&b); if(a!=b){ printf("Not a square matrix");

    } else{ int arr[a][b]; for(int i=0;i<a;i++){ for(int j=0;j<a;j++){ scanf("%d",&arr[i][j]); } } printf("Trace is 2 and normal is 2"); } }


  • 0
    koushik_25  commented on May 10, 2023, 4:14 p.m. edited

    .