第三章例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.\n");
    }
    else{
        printf("The number is odd.\n");
    }

    return 0;

}

 

posted @ 2013-10-02 22:31  刘睿1994  阅读(71)  评论(0编辑  收藏  举报