Powered By Blogger

Feb 11, 2025

18. Find GCD (Greatest Common Divisor)

 #include <stdio.h>

int main() {

    int a, b;

    printf("Enter two numbers: ");

    scanf("%d %d", &a, &b);

    while (b != 0) {

        int temp = b;

        b = a % b;

        a = temp;

    }

    printf("GCD: %d\n", a);

    return 0;

}


No comments:

Post a Comment

Featured Post

Data Analysis

    What is data analysis and its significance?   Data analysis is the process of collecting, transforming, and organizing data to dr...

Popular Posts