Advertisement
DominikPasiut

Untitled

Oct 23rd, 2018
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.41 KB | None | 0 0
  1. #include<stdio.h>
  2.  
  3. int main()
  4.  
  5. {
  6.     printf("Program znajdzie NWD doch podanych liczb\n");
  7.  
  8.     int m,n,r;
  9.     printf("podaj m i n\n");
  10.     scanf("%d %d",&m, &n);
  11.  
  12.     if(m%n!=0)
  13.     {
  14.         while(m%n!=0)
  15.         {
  16.             r=m%n;
  17.  
  18.             if(r!=0)
  19.             {
  20.                 m=n;
  21.                 n=r;
  22.             }
  23.         }
  24.         printf("%d",r);
  25.     }
  26.  
  27.  
  28.  
  29.  
  30.  
  31.     return 0;
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement