My code is only printing the last case. Could anyone help me?
My Code ...
include<stdio.h>
int main(){
int teste,total,i;
float percentpop,percentgeral,percentarq,percentcad,renda,pop,geral,arq,cad;
scanf("%d",&teste);
for(i=1;i<teste;i++){
scanf("%d %f %f %f %f",&total,&percentpop,&percentgeral,&percentarq,&percentcad);
pop=total*(percentpop/100);
geral=(total*(percentgeral/100))*5;
arq=(total*(percentarq/100))*10;
cad=(total*(percentcad/100))*20;
renda=pop+geral+arq+cad;
}
for(i=1;i<teste;i++){
printf("A RENDA DO JOGO N. %d E = %.2f\n",i,renda);
}
return 0;
}