using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections;
using System.Threading;
using System.IO;
namespace CSharpProgram
{
class AkbTechie
{
static void Main(string[] args)
{
bool isPrimeNum = true;
Console.WriteLine("Prime Numbers are : ");
for (int i = 2; i <= 100; i++)
{
for (int j = 2; j <= 100; j++)
{
if (i != j && i % j == 0)
{
isPrimeNum = false;
break;
}
}
if (isPrimeNum)
{
Console.Write("\t" + i);
}
isPrimeNum = true;
}
Console.ReadKey();
}
}
}
output:-
Prime Numbers are :
2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97
0 टिप्पणियाँ