Create a C# program that asks the user for an integer (x) and displays the product of its prime factors.
public class ProductOfFactorsPrimes
public static void Main(string args)
int x = Convert.ToInt32(Console.ReadLine());
int divisor = 2;
while (x > 1)
while (x % divisor == 0)
Console.Write(divisor + "x");
x = x / divisor;
Practice C# anywhere with the free app for Android devices.
Learn C# at your own pace, the exercises are ordered by difficulty.
Own and third party cookies to improve our services. If you go on surfing, we will consider you accepting its use.