fork download
  1. using System;
  2.  
  3. public class Test
  4. {
  5. public static void Main()
  6. {
  7. int k =0,s=0,a=0,flag=0;
  8. Console.WriteLine("Enter the Choice :");
  9. k=Convert.ToInt32(Console.ReadLine());
  10. a=k/2;
  11. Console.WriteLine(a);
  12. for(int h = 2;h <= a;h++)
  13. {
  14. if(k%h==0)
  15. {
  16. Console.WriteLine("Entered number is not PRime Numer");
  17. flag=1;
  18. break;
  19. }
  20. a++;
  21. }
  22. if(flag==0)
  23. {
  24. Console.WriteLine("Entered number is PRime Numer");
  25. }
  26. }
  27. }
Success #stdin #stdout 0.03s 24084KB
stdin
Standard input is empty
stdout
Enter the Choice :
0
Entered number is  PRime Numer