Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Program
- {
- static void Main(string[] args)
- {
- int x, i,N;
- Console.WriteLine("Enter the Value of N");
- N = Convert.ToInt16(Console.ReadLine());
- for (x = 1; x <= N; x++)
- {
- for (i = 2; i < N; i++)
- {
- if (x % i == 0)
- {
- break;
- }
- }
- if(i == x)
- {
- Console.Write(i + "\t");
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment