Untitled
Guest 303 4th Dec, 2022
namespace Rekurencja
{
internal class Program
{
static int czyPierwsza(int a, int i)
{
if (a%i == 0 && a>i)
{
return czyPierwsza(a, i + 1);
}
else
{
if (a == i)
{
return 1;
}
else
{
return 0;
}
}
}
static void Main(string[] args)
{
Console.WriteLine("Podaj liczbe: ");
int liczba = Convert.ToInt32(Console.ReadLine());
int i = 2;
czyPierwsza(liczba, i);
}
}
}
To share this paste please copy this url and send to your friends
RAW Paste Data