title: Is this logical approach right for my program?
body: <p>Program - Rotating matrix 90 degrees clockwise.
  I am a beginner in coding. I came across this question on GeeksforGeeks. I found the solutions very complex so tried applying my logic. But I don't know if my logic is appropriate for the program. Kindly guide me.</p>
  
  <pre><code>#include&lt;stdio.h&gt;
  int main()
  {
      int  A = 0 , a = 0 , b = 0;
      int arr[3][3] = {{1,2,3},{4,5,6},{7,8,9}};
      printf("90 Degree rotation: \n");
      printf("\n");
      for(A = 2; A &gt;= 0; A--)
      {
          for(a = 0; a &lt; 3 ; a++)
          {
              for(b = 0; b &lt; 3 ; b++)
              {
                  if(b==A)
                      printf("%d\t",arr[a][b]);
              }
          }
          printf("\n");
      }
  }
  </code></pre>
  
  <p>Input  </p>
  
  <blockquote>
    <p>1 2 3<br>
    4 5 6<br>
    7 8 9  </p>
  </blockquote>
  
  <p>Output  </p>
  
  <blockquote>
    <p>3 6 9<br>
    2 5 8<br>
    1 4 7  </p>
  </blockquote>