第三章例3-2

/* 判断整数的奇偶性 */
#include<stdio.h>
int main(void)
{
    int number;

    printf("Enter a number:");
    scanf_s("%d",&number);
    if(number%2==0){
        printf("The number is even.
");
    }
    else{
        printf("The number is odd.
");
    }

    return 0;

}

 

原文地址:https://www.cnblogs.com/laurenliu1994/p/3349747.html