help!....
can you give me a statement of looping that use for loop, while, and do while loop at the same time...
and if you can answer the statement it will be more welcome..
thank u ...
peace!

for (int x = 2; x < 100; x++) {
    while (x % 2 != 0) {
        int y = 2;
        bool prime = true;
        do {
            if (x % y == 0) {
                prime = false;
                break;
            }
            y++;
         } while (y < x);
         if (prime) Console.WriteLine("{0} is prime!", x);
    }
}
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.