Notice: Undefined offset: 14191426 in /var/www/html/qa-external/qa-external-users.php on line 744

Notice: Undefined offset: 14564481 in /var/www/html/qa-external/qa-external-users.php on line 744
In C Programming, the code below - What am I missing to change Fahrenheit to Celsius? - OnlineGDB Q&A
Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.

closed In C Programming, the code below - What am I missing to change Fahrenheit to Celsius?

+3 votes
asked Jan 21, 2025 by Juanda L. Scott-Arline (150 points)
closed Feb 1, 2025 by Admin
#include <stdio.h>

int main() {

float fTemp = 100;

printf("Enter the temperature in Fahrenheit: \n");

scanf("%.d", &number);

printf("Celsius: %f \n", (fTemp - 32) * 5/9); *5/9

return 0;
closed with the note: answered

5 Answers

+1 vote
answered Jan 21, 2025 by Sri Raju Paladugu (160 points)

#include <stdio.h>

int main() {

int fTemp;

float Celsius;

printf("Enter the temperature in Fahrenheit: \n");

scanf("%.d", &fTemp);

printf("Celsius: %f \n", (fTemp - 32) * 5/9); 

return 0;

+1 vote
answered Jan 21, 2025 by THATIPALLY RUSHWITH REDDY CSDS2024 (140 points)

#include <stdio.h>
int main() {

int fTemp;
printf("Enter the temperature in Fahrenheit: \n");
scanf("%d", &fTemp);
printf("Celsius: %f \n", (float) (fTemp - 32) * 5/9);  //should use type-casting
return 0;

}

0 votes
answered Jan 28, 2025 by VYAS VED HIMANSHU _185 (200 points)
THIS IS THE CORRECT CODE , I FEEL YOU NEED TO LEARN A LOT OF  BASICS

#include <stdio.h>

int main()

{
    float fTemp;
    
    printf("Enter the temperature in Fahrenheit: \n");
    scanf("%f", &fTemp);

    printf("Celsius: %f \n", (fTemp - 32) * 5/9);

    return 0;
}
0 votes
answered Jan 29, 2025 by AYSHATH RASEENA (250 points)
#<100>(96){f"C-96>}
0 votes
answered Feb 1, 2025 by Shaik Abdul Rehaman (140 points)
dude you allocated 100 value and again you are giving user inputs. just remove =100 from your program
Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and receive answers from other members of the community.
...