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

การเขียนโปรแกรมแบบ iostream.h กับ stdio.h

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

#include
main()
{
int amount,price,pay;
printf("Jacky Shop:\n");
printf("===============\n");
printf("Amount :");
scanf("%d",&amount);
{
printf("Price : ");
scanf("%d",&price);
pay=amount*price
printf("You must pay %d baht\n",pay);
}
printf("===============\n");
}


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

#include
main()
{
int amount,price,pay;
cout<<"Jacky Shop\n";
cout<<"==================\n";
cout<<"Amount :";
cin>>amount;
{
cout<<"Enter Price : ";
cin>>price;
pay=amount*price
cout<<"You must pay "<<<" baht\n";
}
cout<<"===================\n";
}

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

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