SHARE
TWEET

Untitled

a guest May 19th, 2017 36 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4.  
  5. int main()
  6. {
  7.     int i;
  8.     int j;
  9.     int temp;
  10.  
  11.     printf("First number?\n");
  12.     scanf("%d",&i);
  13.     scanf("%c");
  14.     printf("Second Number?\n");
  15.     scanf("%d",&j);
  16.     scanf("%c");
  17.     if (j>i)
  18.     {
  19.         temp = j;
  20.         j = i;
  21.         i = temp;
  22.     }
  23.     while(1)
  24.     {
  25.  
  26.         temp = i%j;
  27.         i=j;
  28.         j=temp;
  29.         if (temp=0)
  30.         {
  31.             printf("%d",j);
  32.             return 0;
  33.         }
  34.     }
  35.     return 0;
  36. }
RAW Paste Data
Want to get better at C?
Learn to code C in 2017
Pastebin PRO Summer Special!
Get 40% OFF on Pastebin PRO accounts!
Top