+ 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 }

23rd Sep 2024, 2:10 AM
Mizan
Mizan - avatar
6 odpowiedzi
+ 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.
23rd Sep 2024, 2:40 AM
Bob_Li
Bob_Li - avatar
+ 2
Thanks
23rd Sep 2024, 4:04 AM
Mizan
Mizan - avatar
+ 2
It looks like you are using an earlier version of c compiler.
23rd Sep 2024, 9:25 AM
Oliver Pasaribu
+ 1
Yeah.🥹
23rd Sep 2024, 5:07 PM
Mizan
Mizan - avatar
0
Your code is almost correct, but there are a few minor issues. https://www.summithealth-patientportal.com
24th Sep 2024, 10:25 AM
Anne165Hernadez
0
Whyy
25th Sep 2024, 2:10 AM
ROHAN RAYPURE
ROHAN RAYPURE - avatar