התוכנית: using System; using System.Collections.Generic; using System.Text; namespace ConsoleApplication1 { class Program static int Mod(int x, int y) while (x >= y) x = x - y; return x; } static void Main(string[] args) int n, m, reminder; Console.WriteLine("Enter two numbers"); n = int.Parse(Console.ReadLine()); m = int.Parse(Console.ReadLine()); while (m > 0) reminder = Mod(n, m); n = m; m = reminder; Console.WriteLine("The GCD is: " + n); התוכנית:
התוכנית: 15,4 using System; using System.Collections.Generic; using System.Text; namespace ConsoleApplication1 { class Program static int Mod(int x, int y) while (x >= y) x = x - y; return x; } static void Main(string[] args) int n, m, reminder; Console.WriteLine("Enter two numbers"); n = int.Parse(Console.ReadLine()); m = int.Parse(Console.ReadLine()); while (m > 0) reminder = Mod(n, m); n = m; m = reminder; Console.WriteLine("The GCD is: " + n); התוכנית: 15,4
התוכנית: Mod??!? using System; using System.Collections.Generic; using System.Text; namespace ConsoleApplication1 { class Program static int Mod(int x, int y) while (x >= y) x = x - y; return x; } static void Main(string[] args) int n, m, reminder; Console.WriteLine("Enter two numbers"); n = int.Parse(Console.ReadLine()); m = int.Parse(Console.ReadLine()); while (m > 0) reminder = Mod(n, m); n = m; m = reminder; Console.WriteLine("The GCD is: " + n); התוכנית: Mod??!?
התוכנית: 15,4 using System; using System.Collections.Generic; using System.Text; namespace ConsoleApplication1 { class Program static int Mod(int x, int y) while (x >= y) x = x - y; return x; } static void Main(string[] args) int n, m, reminder; Console.WriteLine("Enter two numbers"); n = int.Parse(Console.ReadLine()); m = int.Parse(Console.ReadLine()); while (m > 0) reminder = Mod(n, m); n = m; m = reminder; Console.WriteLine("The GCD is: " + n); התוכנית: 15,4
התוכנית: using System; using System.Collections.Generic; using System.Text; namespace ConsoleApplication1 { class Program static int Mod(int x, int y) while (x >= y) x = x - y; return x; } static void Main(string[] args) int n, m, reminder; Console.WriteLine("Enter two numbers"); n = int.Parse(Console.ReadLine()); m = int.Parse(Console.ReadLine()); while (m > 0) reminder = Mod(n, m); n = m; m = reminder; Console.WriteLine("The GCD is: " + n); התוכנית:
static int Mod(int x, int y) { while (x>=y) x=x-y; return x; } הפעולה: static int Mod(int x, int y) { while (x>=y) x=x-y; return x; }
static int Mod(int x, int y) { while (x>=y) x=x-y; return x; }
static int Mod(int x, int y) { while (x>=y) x=x-y; return x; }
התוכנית: using System; using System.Collections.Generic; using System.Text; namespace ConsoleApplication1 { class Program static int Mod(int x, int y) while (x >= y) x = x - y; return x; } static void Main(string[] args) int n, m, reminder; Console.WriteLine("Enter two numbers"); n = int.Parse(Console.ReadLine()); m = int.Parse(Console.ReadLine()); while (m > 0) reminder = Mod(n, m); n = m; m = reminder; Console.WriteLine("The GCD is: " + n); התוכנית:
התוכנית: using System; using System.Collections.Generic; using System.Text; namespace ConsoleApplication1 { class Program static int Mod(int x, int y) while (x >= y) x = x - y; return x; } static void Main(string[] args) int n, m, reminder; Console.WriteLine("Enter two numbers"); n = int.Parse(Console.ReadLine()); m = int.Parse(Console.ReadLine()); while (m > 0) reminder = Mod(n, m); n = m; m = reminder; Console.WriteLine("The GCD is: " + n); התוכנית:
התוכנית: 3 using System; using System.Collections.Generic; using System.Text; namespace ConsoleApplication1 { class Program static int Mod(int x, int y) while (x >= y) x = x - y; return x; } static void Main(string[] args) int n, m, reminder; Console.WriteLine("Enter two numbers"); n = int.Parse(Console.ReadLine()); m = int.Parse(Console.ReadLine()); while (m > 0) reminder = Mod(n, m); n = m; m = reminder; Console.WriteLine("The GCD is: " + n); התוכנית: 3