Contents

Views 10349 Comment 0
?

Shortcut

PrevPrev Article

NextNext Article

Larger Font Smaller Font Up Down Go comment Print
?

Shortcut

PrevPrev Article

NextNext Article

Larger Font Smaller Font Up Down Go comment Print

# 최대 공약수 구하는 함수

#include<stdio.h>
#include<conio.h>

int gcd(int m, int n) {
    if (m<=0) return 0;
    if (n<=0) return 0;
    while(m != n){
        if (m>n) m = m - n;
        else n = n - m;
    }
    return n;
}

void main(){
    int a,b;

    printf("Enter a first Number : ");
    scanf("%d",&a);

    printf("Enter a second Number : ");
    scanf("%d",&b);

    printf("GCD is %d",gcd(a,b));
    getch();
} 


?

List of Articles
No. Category Subject Author Date Views
831 Develop [swift] NotificationCenter 간단 예제 file hooni 2021.01.27 12755
830 Develop [kotlin] 코틀린 안드로이드 앱 버전/빌드 정보 hooni 2020.12.15 2806
829 Develop [ubuntu] 우분투 18.04에 PHP5 설치하기 hooni 2020.11.14 3265
828 Develop [js] Text 값을 클립보드에 복사하기 hooni 2020.10.10 2726
827 Develop [sh] 쉘스크립트 if 비교 연산 hooni 2020.05.26 64333
826 Develop [sh] html 안에 있는 img 다운 받는 쉘 스크립트 file hooni 2020.05.26 2556
825 Develop [ios] Start developing your navigation app for CarPlay without enrollment file hooni 2020.02.22 132669
824 Develop [php] 3 Ways to Detect Mobile or Desktop in PHP file hooni 2020.01.28 7600
823 Develop 자주 쓰는 Docker 명령어 alias hooni 2020.01.10 289375
822 Develop [python][django] request.cookie 읽어오기 ㅋㅋㅋ (쓰기) hooni 2019.12.06 3680
821 Develop [python] 파라미터 앞에 *, ** 의 의미? (*args, **kwargs) hooni 2019.11.22 3782
820 Develop 링크들 보고 지울 내용 secret hooni 2019.11.21 0
Board Pagination Prev 1 2 3 4 5 6 7 8 9 10 ... 71 Next
/ 71