I'm learning how to program in C using André Backes' Complete and uncomplicated C language book. You have an exercise that I can not get the answer to. Follow the Statement:
(The exercise has been slightly changed.) Make a program that reads a worker's salary and borrowed loan amount. If the loan amount:
- For 20% greater than the salary , print: "Loan not granted."
- Otherwise , print: "Loan Granted."
below is my code
int n1; // salário
int n2; // valor empréstimo
int resultado;
scanf ("%d %d",&n1,&n2);
resultado = n2/n1;
if (resultado <= 1.2){
printf("emprestimo concedido");
}else{
printf("emprestimo nao concedido");
}
return 0;