c语言for循环嵌套if语句

2022-08-05 社会 58阅读
#include 
int main(int argc, char* argv[])
{
    int i, j;
    for (i = 0; i < 100; i++)
    {
        printf("外循环i=%d\n", i);
        for (j = 0; j < 10; j++)
        {
            i = i + 10;
            printf("内循环i=%d\n", i);
            if (i < 100)
            {
                printf("退出内层循环,回到外层循环\n");
                break;
            }
            else
            {
                printf("退出外层循环\n");
                goto EndForLoop;
            }
        }
    }
EndForLoop:
    printf("已经退出外层循环");
    return 0;
}
声明:你问我答网所有作品(图文、音视频)均由用户自行上传分享,仅供网友学习交流。若您的权利被侵害,请联系fangmu6661024@163.com