100<a<200 和 100<b<200 的前两个条件执行得很好,但是两者都在 100 和 200 之间的条件不知道为什么?我的代码:
#include<stdio.h>
int main()
{
int a,b;
printf("Enter the first integer:");
scanf("%d",&a);
printf("Enter the second integer:");
scanf("%d",&b);
if (100<=a&&a<=200)
{printf("The integer %d lies between 100 and 200",a);}
else if (100<=b&&b<=200)
{printf("The integer %d lies between 100 and 200",b);}
else if((100<=a&&a<=200)&&(100<=b&&b<=200))
{printf("Both of the integers lie between 100 and 200");}
else
{printf("The integers does not lie between 100 and 200");}
return 0;
}
输出: 在此处输入图像描述