void main()
{
int num;
printf("Enter a number: \n");
scanf("%d", &num);
if (num > 0)
printf("%d is a positive number \n", num);
else if (num < 0)
printf("%d is a negative number \n", num);
else
printf("0 is neither positive nor negative");
}
结果
Enter a number:
-3
-3 is a negative number
除教程外,本网站大部分文章来自互联网,如果有内容冒犯到你,请联系我们删除!