源程序判断数字的奇偶性 include <stdio.h> int main(void) i int number; printf( Enter a number: scanf( %d,&number) Enter a number: 1028 if(number %2==0) Tne number is even print(° Tne number is evenⅦn"); Enter a number: 329 7 elset Tne number is odd printf("Tne number is odd. In") return 0: 此处条件内由于只有一条 语句,故{}可省略源程序-判断数字的奇偶性 #include <stdio.h> int main(void) { int number; printf("Enter a number: "); scanf("%d", &number); if(number % 2 == 0){ printf("Tne number is even. \n"); } else{ printf("Tne number is odd. \n"); } return 0; } Enter a number: 329 Tne number is odd. Enter a number: 1028 Tne number is even. 此处条件内由于只有一条 语句,故{ }可省略