Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.

program for euclid problem

+2 votes
asked Feb 26, 2020 by anonymous

1 Answer

+1 vote
answered Oct 15, 2022 by Gayathri Anbalagan (160 points)

This is the C program for Euclids Algorithm

#include <stdio.h>
 

int gcd(int x, int y)
{
    if (x== 0)
        return y;
    return gcd(y % x, x);
}
 

int main()
{
    int x = 10, y= 15;
    printf("GCD  is (%d, %d) = %d\n", x, y, gcd(x, y));
   
    return 0;
}

Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.
...