Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- class CalculateGCD
- {
- static void Main()
- {
- Console.Write("a = ");
- int a = int.Parse(Console.ReadLine());
- Console.Write("b = ");
- int b = int.Parse(Console.ReadLine());
- int c = 0;
- while (b != 0)
- {
- c = b;
- b = a % b;
- a = c;
- }
- Console.WriteLine(a);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement