int given_no = 8, i = 2, c = 0;
while (i < given_no && c != 1)
{
if (given_no % i == 0)
c = 1;
i++;
}
if (c == 0)
lblmessgae.Text = "given number is prime";//print statement
else
lblmessgae.Text = "given number is not prime";//print statement
Tag: Prime Number, Prime Number in asp.net, Prime Number in asp.net with c#, Prime Number in c, Prime Number in c#, Prime Number in c++, Prime Number Logic, Prime Number program in c, Prime Number program in cpp
I actually enjoyed reading through this posting.Many thanks.
ReplyDeleteConsulting - cPrime