เว็บไซต์เราจะอยู่ไม่ได้หากขาดเขาเหล่านี้ รวมช่วยกันสนับสนุนสปอนเซอร์ของพวกเรา
-
รบกวนใครพอรู้ ภาษา c แนะนำผมทีครับ
คือว่าผมเพิ่งได้ เริ่มฝึกภาษา c จากหนังสือแล้วลอง มาเขียนเอง เป็นเหมือนโปรแกรมคิดเลขธรรมดามากเลยนะครับ
พวก บวก ลบ คูณ หาร ใส่เลข 2จำนวน เข้าไปถ้า บวกกันได้เท่าไหร่ ลบกันได้เท่าไหร่ประมาณนี้ครับ
แต่เวลาผม compile มันติดตรงคำว่า getch(); กับ return 0; ส่วนโค้ดเป็นแบบนี้ครับ (คือผมไม่มั่นใจว่าเขียนถูกหรือเปล่า หรือมันต้องเพิ่มตัวแปรอีก)
#include<stdio.h>
#include<conio.h>
int main()
{
float num1,num2,;
printf("Calculator*****\n");
printf("Please enter first number : ");
scanf("%f",&num1);
printf("Please enter second number : ");
scanf("%f",&num2);
printf("After*********\n");
printf("num1+num2\t = %f\n", num1+num2);
printf("num1-num2\t = %f\n", num1-num2);
printf("num1*num2\t = %f\n", num1*num2);
printf("num1/num2\t = %f",num1/num2);
getch();
return0;
}
-
กฎการส่งข้อความ
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules