Q:

Breaking out of the if-statement but not from the for-loop

How can I make this code only break out of the inner if-statement rather than stopping the for-loop?
#include <stdio.h>

int main()
{
    int i,j;

    for(i=0;i<10;i++)
    {
        if((i==2 || i==8 || i==4))
        {
            printf("\ni is %d\n",i);

            if(i==4)
            {
                printf("\ni is %d\n",i);
                break;
            }
            else
            {
                printf("\ni is not 4\n");
            }
        }
        else
        {
            printf("\nnext\n");
        }
        printf("\ngoes out of innner if\n");
    }
    return 0;
}

This loop breaks out at i=4.  Is there any way to break out at i-4 and continue with the for-loop until i<10?

A:

I think the continue statement may be the thing you are looking for.
Also be aware that if() is not a loop.

