age++是程序执行age后加1 , 后一个if中的65赋给a,然后while执行age=65进入循环,之后age+1是66,但是在循环中,65再次赋值给age,不是66了,这样不停的赋值将age=66改为age=65 所以一直输出65
#include<stdio.h>
int main(void)
{
int age = 20;
while (age++ <=65)/*因为 ++ 优先级 高于 <=,所以先执行++即age=21*/
{
if ((age % 20) == 0)/**/
printf("You are %d. Here is a raise.\n", age);
if (age = 65)
printf("You are %d. Here is your gold watch.\n", age);
}
return 0;
}