title: How to calculate the gcd of two numbers via Euclidean's algorithm
body: <p>I have written a sample program to calculate the gcd of two numbers. Here it is:</p>
  
  <pre><code>#include stdio.h
  
  int main(void) {
      int m, n, rem;
  
      printf("Enter two numbers consecutively(with a space between them): ");
      scanf("%d %d", &amp;m, &amp;n);
  
      while (m) {
          n = m % n; //problem here 
          n = rem;
      }
  
      printf("%d is the GCD", rem);
  
      return 0;
  }          
  </code></pre>
  
  <p>I think that I am supposed to store the output of the modulo operator statement in rem but so far my program does not respond to any input given. Can somebody give me a clue.</p>