วันเสาร์ที่ 16 กรกฎาคม พ.ศ. 2554

ข้อ 7 week 5 ค่ะ

#include<stdio.h>
#include<conio.h>
main()
{
      int i,a,b,d ;
      char Out='Y';
      do
      {
        printf("Enter Number : ");
        scanf("%d",&a);
        if (a%2==0)
        {
                 printf("%d is even number\n",a);
        }
        else if (a%2!=0)
        {
           printf("%d is odd number\n",a);
        }
        printf("Do you want to continue(Y/N):" );
        //scanf("%c",&Out);
        Out=getche();
        printf("\n");
      }
      while(Out=='Y');
      getch();
}

ไม่มีความคิดเห็น:

แสดงความคิดเห็น