-1
Why is this code on loop infinite?
#include <stdio.h>
#include <stdlib.h>
#include <conio.h>
int main()
{
int i;
float salario[10], valorDataBase, salarioReajustado[10];
printf("Informe o percentual de reajuste da data-base: \n");
scanf("%f", &valorDataBase);
for (i=0 ; i<10 ; i=i++)
{
printf("Informe o seu salario atual: \n");
scanf("%f", &salario[i]);
}
//Impressão da lista de dados do vetor salario reajustado
for (i=0 ; i<10 ; i=i++)
{
salarioReajustado[i] = salario[i] + salario[i]*valorDataBase/100;
printf("Seu salario reajustado sera %f \n",salarioReajustado[i]);
}
getch();
return(0);
}
i=i++
should only bei++
– Isac
Did the answer solve your question? Do you think you can accept it? See [tour] if you don’t know how you do it. This would help a lot to indicate that the solution was useful for you. You can also vote on any question or answer you find useful on the entire site (when you have 15 points).
– Maniero