วันอังคารที่ 9 กันยายน พ.ศ. 2551

4.ให้เขียนโปรแกรมรับตัวเลข 0-100 โดยเปรียบเทียบกับเลข 50 แล้วบอกว่ามากกว่าหรือน้อยกว่า 50
วิธีทำ

#include
#include
main()
{
clrscr();
int number;
printf("Input a number 0-100 : ");
scanf("%i",&number);
if(number<50);
printf("%i is <50",number);
else if(number==50)
printf("%i is =50",number);
elseprintf("%i is >50");
getch();
}

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