I'm having some trouble with this simple for loop using user inputs question. The problem wants me to create a table that converts fahrenheit to celcius, taking user input values for the starting, ending, and increment values for the table using scanf. I've only been coding for 2 weeks, and I just started loops, but this seems like it should work. Thanks! Here is the code I have:
#include <stdio.h>
int main (void)
{
int f, c, f_min, f_max, i;
printf("Enter the minimum (starting) temperature value: ");
scanf("%d", &f_min);
printf("Enter the maximum (ending) temperature value: ");
scanf("%d", &f_max);
printf("Enter the table increment value: ");
scanf("%d", &i);
for (f = scanf("%d", &f_min); f <= scanf("%d", &f_max); f = f + scanf("%d", &i))
{
c = ((f - 32.0) * (5.0 / 9.0));
// printf("Degrees in C is: %d");
}
return 0;
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…