วันอังคารที่ 28 กรกฎาคม พ.ศ. 2552

การบ้าน iostream.h และ stdio.h

<เขียนโปรแกรมโดยใช้ stdio.h >

#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 "<<<" baht\n"; cout<<"* * * * * * * * * * * * * * *\n"; cout<<"Enter Amount : "; cin>>amount;
}
cout<<"* * * * * * * * * * * * * * *\n"; cout<<"Thank you"; }

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

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