Advertisement
pojler

NWD

Oct 16th, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. int main(int argc, char *argv[])
  2. {
  3. int a,b,c,i,j;
  4. printf("podaj pierwsza liczbe");
  5. scanf("%d", &a);
  6. printf(" \n podaj drugą liczbe");
  7. scanf("%d", &b);
  8. if(b>a)
  9. {
  10. c=b;b=a;a=c;
  11. }
  12. for(i=a; i>0; i--)
  13. {
  14. if ((b%i==0) && (a%i==0))
  15. {printf("Najwiekszy wspolny dzielnik= %d" ,i);
  16. i=0;
  17. }
  18. }
  19.  
  20. return 0;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement