Dot Net Funda provides content about Dot Net Concept From Bsic to advance.
1. Small Program/code
2.Problem Solution (Post your Problem and get solution of your problem)
3. Give suggestion about our Post.
Monday, September 17, 2018
check number is Prime or not Prime in c#.
int number = 13; int pr = 0; for (int i = 2; i < number; i++) { if (number % i == 0) { pr++; } } if (pr > 0) { Console.WriteLine("No is not Prime"); } else { Console.WriteLine("No is Prime"); }
No comments:
Post a Comment