C Program to write Finance Program Logic.
How does this program work?
- This code helps to how to write Finance Program logic.
Here is the code
int main()
{
int kdm,t,amt,s,g,v,p,total=0;
float i=0,emi=0,r;
printf("Welcome to Muthoot Finance\n");
printf("Please enter the kdm mark of the gold you produced\n 1.24 karat and 91.6\n 2.18 karat and 91.6\n");
scanf("%d",&kdm);
printf("Enter your State Name\n 1.Andhra Pradesh\n 2.Telangana\n 3.Chennai\n");
scanf("%d",&s);
printf("Enter the grams of gold submitted for loan:\n ");
scanf("%d",&g);
if(kdm==1)
{
switch(s)
{
case 1:
{
printf("Your state is Andhra Pradesh\n");
v=3300;
amt=3300*g;
printf("Enter the Rate of interest:\n");
scanf("%f",&r);
t=amt/20;
printf("Enter the percentage of amount given after taking fade from it:\n");
scanf("%d",&p);
total=p*(amt-t)/100;
printf("Total amount to be given is:%d\n",total);
i=(6*r*total)/100;
printf("Intrest is:%f\n",i);
if((total+i)<(amt-t))
{
emi=(total+i)/6;
printf("Total Emi paid per month is:%f\n",emi);
printf("EMI should be paid in 6months or else Additional intrest will occur\n");
}
else
{
printf("Loan amount is crossing the limits we can't help you\n");
}
}
break;
case 2:
{
printf("Your state is Telangana\n");
v=3000;
amt=3000*g;
printf("Enter the Rate of interest:\n");
scanf("%f",&r);
t=amt/20;
printf("Enter the percentage of amount given after taking fade from it:\n");
scanf("%d",&p);
total=p*(amt-t)/100;
printf("Total amount to be given is:%d\n",total);
i=(6*r*total)/100;
printf("Intrest is:%f\n",i);
if((total+i)<(amt-t))
{
emi=(total+i)/6;
printf("Total emi paid per month is:%f\n",emi);
printf("EMI should be paid in 6months or else Additional interest will occur\n");
}
else
{
printf("Loan amount is crossing the limits we can't help you\n");
}
}
break;
case 3:
{
printf("Your state is Chennai\n");
v=3200;
amt=3200*g;
printf("Enter the Rate of interest:\n");
scanf("%f",&r);
t=amt/20;
printf("Enter the percentage of amount given after taking fade from it:\n");
scanf("%d",&p);
total=p*(amt-t)/100;
printf("Total amount to be given is:%d\n",total);
i=(6*r*total)/100;
printf("Intrest is:%f\n",i);
if((total+i)<(amt-t))
{
emi=(total+i)/6;
printf("Total emi paid per month is:%f\n",emi);
printf("EMI should be paid in 6months or else Additional interest will occur\n");
}
else
{
printf("Loan amount is crossing the limits we can't help you\n");
}
}
break;
default:
printf("Wrong Choice");
}
}
else if(kdm==2)
{
switch(s)
{
case 1:
{
printf("Your state is Andhra Pradesh\n");
v=3000;
amt=3000*g;
printf("Enter the Rate of intrest:\n");
scanf("%f",&r);
t=amt/20;
printf("Enter the percentage of amount given aftrr taking fade from it:\n");
scanf("%d",&p);
total=p*(amt-t)/100;
printf("Total amount to be given is:%d\n",total);
i=(6*r*total)/100;
printf("Intrest is:%f\n",i);
if((total+i)<(amt-t))
{
emi=(total+i)/6;
printf("Total emi paid per month is:%f\n",emi);
printf("EMI should be paid in 6 months or else Additional interest will occur\n");
}
else
{
printf("Loan amount is crossing the limits we can't help you\n");
}
}
break;
case 2:
{
printf("Your state is Telangana\n");
v=2900;
amt=2900*g;
printf("Enter the rate of intrest:\n");
scanf("%f",&r);
t=amt/20;
printf("Enter the percentage of amount given aftr taking fade from it:\n");
scanf("%d",&p);
total=p*(amt-t)/100;
printf("Total amount to be given is:%d\n",total);
i=(6*r*total)/100;
printf("Intrest is:%f\n",i);
if((total+i)<(amt-t))
{
emi=(total+i)/6;
printf("Total emi paid per month is:%f\n",emi);
printf("EMI should be paid in 6 months or else Additional interest will occur\n");
}
else
{
printf("Loan amount is crossing the limits we can't help you\n");
}
}
break;
case 3:
{
printf("Your state is Chennai\n");
v=3100;
amt=3100*g;
printf("Enter the rate of intrest:\n");
scanf("%f",&r);
t=amt/20;
printf("Enter the percentage of amount given after taking fade from it:\n");
scanf("%d",&p);
total=p*(amt-t)/100;
printf("Total amount to be given is:%d\n",total);
i=(6*r*total)/100;
printf("Intrest is:%f\n",i);
if((total+i)<(amt-t))
{
emi=(total+i)/6;
printf("Total emi paid per month is:%f\n",emi);
printf("EMI should be paid in 6 months or else Additional interest will occur\n");
}
else
{
printf("Loan amount is crossing the limits we can't help you\n");
}
}
break;
default:
printf("Wrong Choice");
}
}
else
printf("Wrong Choice");
}