Advertisement
Guest User

Untitled

a guest
Feb 10th, 2013
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.27 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int main(void)
  4. {
  5.   int m, n, rem;
  6.  
  7.   printf("Enter two numbers consecutively(with a space between them): ");
  8.   scanf("%d %d", &m, &n);
  9.  
  10.   while (m)
  11.   {
  12.   rem = m;
  13.   m = n % rem;
  14.   n = rem;
  15.   }
  16.  
  17.   printf("%d is the GCD\n", n);
  18.  
  19.   return 0;
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement