循环时while(1)vs while(3)或任何数字

Tus*_*shi 1 loops while-loop do-while

使用while循环时写入while(1)与任何其他数字相比意味着什么?

在我的计划while(1)中给我同样的答案while(3)

int num1;
int loopcount;

while(1) {
    printf("enter your positive number:");
    scanf("%d",&num1);
    if(num1>0) {
        break;
    }
}
Run Code Online (Sandbox Code Playgroud)

Ode*_*ded 5

在C中,比其它任何整数值0被视为true为条件语句.