【发布时间】:2021-01-26 08:28:36
【问题描述】:
我的代码行为异常。在循环 1 中它运行良好,但在循环 2 中它会自动打印 ASCII 值 10。请帮助!
#include<stdio.h>
int main(){
char c;
int loop =1;
do{
printf("\nLoop = %d\nWrite character of which you want to find acii values: ", loop);
scanf("%c", &c);
printf("\nASCII value of %c is %d.", c, c);
loop++;
}while(c != 'Z');
printf("\n******END*****");
return 0;
}
【问题讨论】: