Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace ConsoleApp1
- {
- class Program
- {
- static void Main(string[] args)
- {
- string doseArithmo;
- int arithmos;
- Arxh:
- int count = 0;
- Console.WriteLine("Dose enan arithmo");
- doseArithmo = Console.ReadLine();
- arithmos = int.Parse(doseArithmo);
- for (int i = 2; i < arithmos; i++)
- {
- if (arithmos % i == 0)
- {
- count = count + 1;
- }
- }
- if (count < 1)
- {
- Console.WriteLine("O arithmos {0} einai protos", arithmos);
- }
- else
- {
- Console.WriteLine("O arithmos {0} den einai protos", arithmos);
- }
- goto Arxh;
- }
- }
- }
Add Comment
Please, Sign In to add comment