Advertisement
lammac

UCLN của 2 số

Apr 3rd, 2020
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.22 KB | None | 0 0
  1. #include<stdio.h>
  2.  
  3. int main() {
  4.    int a, b, i, hcf;
  5.    scanf("%d%d", &a, &b);
  6.    for(i = 1; i <= a || i <= b; i++) {
  7.    if( a%i == 0 && b%i == 0 )
  8.       hcf = i;
  9.    }
  10.  
  11.    printf("%d", hcf);
  12.    
  13.    return 0;
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement