在这里,我有一个代码应该在循环的第一个序列之后打印“错误” ,因为根据我之前的问题Print an “Error” statement after do-while loop in C它只会读取循环的第一个条件,因为“ short cicuiting ”并且只会在循环的第一个序列之后执行......在解决之后我仍然无法显示“错误!”,所以我尝试添加&& getch()
它给了我一个输出
Error!
现在我有 3(多个)条件导致“错误!” 要在第一个序列中执行,我想知道C 如何响应我的多个条件,这可能有助于我解决错误。
我的代码:
#include <stdio.h>
#include <conio.h>
void main(){
int inp;
while(inp<10 && printf("Error") && getch()){
clrscr();
printf("Enter Number > 10: ");
scanf("%d",&inp);
}
printf("Right Answer!");
getch();
}