|
|
Turbo c++ อยากให้โปรแกรมจบการทำงานครับ เมือ id=9 ควรทำยังไงครับ |
|
|
|
|
|
|
|
Code
#include<stdio.h>
#include<conio.h>
void main(void)
{
clrscr();
int id,number,enterchange;
float price,discount,amount,change;
gotoxy(1,17);
cprintf("Enter id of product : "); scanf("%d",&id); gotoxy(25,17);
if (id==1)
printf("Chcolate Pudding 40 Bath\n");
else
gotoxy(1,18);
printf("Enter id of number : "); scanf("%d",&number);
if (id==1)
price=(40*number);
printf("The total of money : %.2f\n",price);
if(number>=10)
{
discount=price*0.1;
printf("discount : %.2f\n",discount);
}
else
if(number>=5)
{
discount=price*0.05;
printf("discount : %.2f\n",discount);
}
else
if(number<5)
{
discount=price*0 ;
printf("No discount : %.2f\n",discount);
}
amount=price-discount;
printf("the amount of money : %.2f\n",amount);
if(amount)
{
printf("Enter Change : "); scanf("%d",&enterchange) ;
}
change=enterchange-amount ;
printf("Change : %.2f\n",change);
gotoxy(1,24);
cprintf("BY Sarun Wattanayothin 6232040073");
getch();
}
Tag : - - - -
|
ประวัติการแก้ไข 2019-07-21 11:37:20
|
|
|
|
|
Date :
2019-07-20 22:21:04 |
By :
Sarun003 |
View :
1109 |
Reply :
1 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Code (Turbo c++)
if (id=9) {
return;
}
|
|
|
|
|
Date :
2020-08-02 23:13:45 |
By :
PhrayaDev |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 05
|