I have a user input, and I need the loop to continue for the next 4 iterations of the user input. I have no idea how because everytime I try to do it, it becomes either and infinite loop or just crashes.. Please help
Code:
#include <stdio.h>
int main ()
{
double H, t;
double a, b;
a = 2.13;
b = 0.05;
printf("Please enter input fot t:");
scanf("%lf", &t);
H = ((a * t)*(a * t))-((b * t)*(b * t)*(b * t));
if (H > 100)
{
printf("\nHigh\n");
}
else if (H > 50)
{
printf("Average\n");
}
else
{
printf("Low\n");
}
printf("\nt\t\t H\n");
printf("----------------------\n");
for (t=t; t < (t + 5); t++)
{
H = ((a * t)*(a * t))-((b * t)*(b * t)*(b * t));
printf("%.0f\t\t%.2f\n", i, H);
}
return 0;
}
Comment