如果我输入的数字超过 5 位,则会显示错误的数字。例如:
Enter Integer: 123456
-7616 is EVEN.-7616 is ODD.
我的老师希望我们使用 Turbo C++,但它有时会在我运行程序后冻结,所以我使用了 OnlineGDB(https://www.onlinegdb.com)(语言:C(TurboC))。这是我的代码:
#include <stdio.h>
#include <conio.h>
int number;
int main()
{
clrscr();
printf("Enter Integer: ", number);
scanf("%d", &number);
if ((number%2)==0)
{
printf("%d is EVEN.", number);
}
printf("%d is ODD.", number);
getch();
return(0);
}