#include
main()
{
int price,amount,pay;
printf("Enter Amount :");
scanf("%d",&amount);
while(amount!=0)
{
printf("Enter Price : ");
scanf("%d",&price);
pay=price*amount;
printf("You must pay %d baht\n",pay);
printf("* * * * * * * * * * * * * * *\n");
printf("Enter Amount : ");
scanf("%d",&amount);
}
printf("* * * * * * * * * * * * * * *\n");
printf("Thank you");
}
<เขียนโปรแกรมโดยใช้ iostream.h >
#include
main()
{
int price,amount,pay;
cout<<"Enter Amount :"; cin>>amount;
while(amount!=0)
{
cout<<"Enter Price : "; cin>>price;
pay=price*amount;
cout<<"You must pay "<
}
cout<<"* * * * * * * * * * * * * * *\n"; cout<<"Thank you"; }

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