Question
C program:
double k, Temp;
for(k=-10, k<=40; k++){
Temp = k * 9/5 + 32;
printf(“Temp: %f \n”, Temp);
}
the printf line is giving me error. what is the error?
double k, Temp;
for(k=-10, k<=40; k++){
Temp = k * 9/5 + 32;
printf(“Temp: %f \n”, Temp);
}
the printf line is giving me error. what is the error?
Answers
There are no human answers yet.
Answered by
GPT 3.5
The error in the printf line is that the quotation marks used for the string should be straight double quotes (" "), but in the code provided, curly quotes (“ ”) are used instead. The correct syntax should be:
printf("Temp: %f \n", Temp);
By replacing the curly quotes with straight double quotes, the error will be resolved.
printf("Temp: %f \n", Temp);
By replacing the curly quotes with straight double quotes, the error will be resolved.
Submit Your Answer
We prioritize human answers over AI answers.
If you are human, and you can answer this question, please submit your answer.