for(int i = 0; i < floorNum; i++){
    if(floorNum == 12){ 
        continue;
    {
    statements;
    statements;
    statements;
  
}

-------------------
if there anything wrong with this statement? i've tried using a while loop and the continue statement would work and skip number 12, but this doesn't work.

Recommended Answers

All 2 Replies

You probably want to compare i against 12 rather than floorNum:

#include <iostream>

int main()
{
    for (int i = 0; i < 20; i++) {
        if (i == 12)
            continue;

        std::cout<< i <<'\n';
    }
}

oh snap! what was i thinking?? thanks!!!!!!

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.