x น้อยกว่า y จะแสดงคำว่า Less than ออกจอภาพ
x มากกว่า y จะแสดงคำว่า More than ออกจอภาพ
ซึ่งฟังก์ชั่น มีการเรียกใช้งานดังนี้ compare(5,7);
#include
#include
int compare(x,y);
int main(void)
{
int x,y;
printf("Input 2 integers :");
scanf("%d %d",&x,&y);
compare(x,y);
return 0;
}
compare(x,y)
{
if(x==y)
{
printf("EQUAL !");
}
if(x<0)
{
if(y<0)
{
x = abs(x);
y = abs(y);
if(x
printf("Less than!");
}
else
printf("Less than!");
}
if(y<0)
{
if(x<0)
{
x = abs(x);
y = abs(y);
if(x
printf("Less than");
}
else
printf("More than!");
}
else
if(x>y)
printf("More than");
if(x
It's so difficult.
ตอบลบอันนี้ยากอ่าา ><
ตอบลบเกิดไรขึ้นไม่รู้ พิมแล้วส่วนท้ายไม่ครบ
ตอบลบตงinclude วงเล็บก้อหายอ่ะ
ตรง include หายทุกคนเลย
ตอบลบแก้ไข ต่อจากในตัวอย่างน่ะ เพิ่ม บรรทัดต่อไม่ได้ เพราะอะไร
ตอบลบต่อจากบรรทัดล่างสุด
if(x<y)
printf("less than");
}
อ่าห้ะๆๆ
ตอบลบยากมากกกก
ตอบลบอันนี้ง่ายตะหากแฮม :))
ตอบลบยากจังเลย
ตอบลบโหยทั้งยากทั้งยาวว
ตอบลบ