write a program to input numbers into an array of 3 rows and 3 columns .find out the sum of the numbers in the diagnol element .no element should be repeated twice
Answers
Answered by
1
Required algorithm:
for (i 0 to 2)
for(j 0 to 2)
stdin a[i][j]
for (i 0 to 2)
for(j 0 to 2)
if i ==j print a[i][j]
for (i 0 to 2)
for(j 0 to 2)
stdin a[i][j]
for (i 0 to 2)
for(j 0 to 2)
if i ==j print a[i][j]
Similar questions