Friday, 26 August 2011

Prime Number Logic


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

1 comment:

Parsing JSON w/ @ symbol in it

To read the json response like bellow @ concatenated with attribute                             '{ "@id": 1001, "@name&q...