#include <studio.h>
void main ()
{
char next ;
int amount,deposit,inst;
float interest;
do {
printf("enter car price:");scanf("%d",&amount);
printf("enter deposit:");scanf("%d",&deposit);
printf("enter inst:");scanf("%d",&inst);
total=amount-deposit;
inst=total+inst+months;
total/months=(total+inst)/months;
12 months=0.03;
24 months=0.0325;
48 months=0.035;
60 months=0.04;
72 months=0.0425;
if(interest=12 months){
interest= 0.03;
}
if(interest=24 months){
interest= 0.0325;
}
if(interest= 48 months){
interest= 0.035;
}
if(interest=60 months){
interest= 0.04;
}
if(interest= 72 months){
interest= 0.0425;
}
}}
ภาษาc++ผมผิดตรงไหนหรอครับช่วยดูให้หน่อยครับ มันไม่รัน
void main ()
{
char next ;
int amount,deposit,inst;
float interest;
do {
printf("enter car price:");scanf("%d",&amount);
printf("enter deposit:");scanf("%d",&deposit);
printf("enter inst:");scanf("%d",&inst);
total=amount-deposit;
inst=total+inst+months;
total/months=(total+inst)/months;
12 months=0.03;
24 months=0.0325;
48 months=0.035;
60 months=0.04;
72 months=0.0425;
if(interest=12 months){
interest= 0.03;
}
if(interest=24 months){
interest= 0.0325;
}
if(interest= 48 months){
interest= 0.035;
}
if(interest=60 months){
interest= 0.04;
}
if(interest= 72 months){
interest= 0.0425;
}
}}