title: How to reverse a 3 digit number
body: <p>Code:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  
  int main()
  {
      int n, num1,num2,num3, reverse;    
  
      printf("Enter the number to reverse:\n");
      scanf("%d", &amp;n);
  
      num1 = n / 100;
      num2 = (n % 100) / 10;
      num3 = (n % 10) / 100;
  
      reverse = num3*100+ num2*10;
  
      printf(" The reverse is %d", reverse);
  
      system("pause");
      return 0;
  }
  </code></pre>
  
  <p>I wanted to reverse a number without using any loops, I included the steps so far, but Im not sure if it is right or not:</p>
  
  <ol>
  <li>Declare the int into num1, num2 and num3 along witht the output, reverse</li>
  <li>Ask the user to enter a number to reverse</li>
  <li>Store the number using scanf</li>
  <li>Get the last digit of the number , num1= n/100</li>
  <li>Get the middle digit from the user, num2=(num%100)/10</li>
  <li>To get the last digit from the user, num3=(num%10)/100</li>
  </ol>
  
  <p>Are these steps right?
  I tried working with the program but no luck whatsoever, until I get the steps correct.</p>
  
  <p>Example:</p>
  
  <pre><code>Enter a number: 263
  Output: 362
  </code></pre>
  
  <p>The number is always 3 digits, no change whatsoever</p>