C# Program to find prime Numbers and total prime Numbers in given range – C# Programming Example
C# Console For Loop If Else Statement

C# Program to find prime Numbers and total prime Numbers in given range

In this program, you’ll learn to print all prime numbers within an interval using for loops and display it.

A positive integer greater than 1 which has no other factors except 1 and the number itself is called a prime number.

2, 3, 5, 7 etc. are prime numbers as they do not have any other factors. But 6 is not prime (it is composite) since, 2 x 3 = 6.

C# Code:

Output:

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: