Take FREE!! Online Mettl Mock Test to Crack TechM and Other Companies Written Exams.
Get Off-Campus Placement Jobs Info !!!
TCS NQT Technical and Managerial Round Interview Questions

Program Discussion :: Basics

Home > Programs > Basics

5 / 265

Write a program to print the matrix element in clock-wise and anti clock-wise sprial, if the given value of i=0 and i=1
Ex.
| 1 2 3 4 |
| 5 6 7 8 |
| 9 10 11 12 |
| 13 14 15 16 |
OutPut:
For i=0
1 2 3 4 8 12 16 15 14 12 9 5 6 7 11 10
for i=1
1 5 9 13 14 15 16 12 8 4 3 2 6 10 11 7

Answer:


Asked In :: Cavium Networks

Post Your Answer Here: