+ 2
Is this code correct?
#include <stdio.h> #include <conio.h> main() { float C,F ; printf ("Enter the number of Centigrade : ") ; scanf (" %f ", &C); F = 9*C/5+32; printf ("The value of Farenheight is % 2f\n ", F); return 0 }
6 Antworten
+ 6
Remove conio.h
The return type of main is int. So it should be:
int main(){
}
Use lowercase for your variables. capitals are usually used for constants.
Add a semicolon to the end of return 0
return 0;
Centigrade is an old term. Celsius is the modern unit.
You should add a dot in front of 2 in your float format specifier
printf("The value of Fahrenheit is %.2f\n", f);
Fahrenheit not Farenheight.
+ 2
Thanks
+ 2
It looks like you are using an earlier version of c compiler.
+ 1
Yeah.🥹
0
Your code is almost correct, but there are a few minor issues. https://www.summithealth-patientportal.com
0
Whyy