Create a program to find the GCD (Greatest Common Divisor) of two numbers.
Student
I am Utpal Vishwas from Uttar Pradesh. Have completed my B. Tech. course from MNNIT campus Prayagraj in 2022. I have good knowledge of computer networking.
Sure, here is a C# program to find the GCD of two numbers:
C#
This program will first prompt the user to enter two numbers. It will then use Euclid's algorithm to find the GCD of the two numbers. Euclid's algorithm works by repeatedly finding the remainder of the division of one number by the other. The algorithm terminates when the remainder is 0, which means that the two numbers are relatively prime. The GCD is then equal to the last non-zero remainder.
The program will then print the GCD of the two numbers.