I WANT THIS BUT I CAN NOT UNDER STAND PLZ HELP WHAT CHANGES I SHOUL DO HERE
I WANT TO MAKE quick estimation by taking the temperature in Celsius, double it and add 32 AND WANT TO Write a program that takes temperature in Celsius; convert it to Fahrenheit both in estimation method and actual method. Run the program at least for 10 values and print the temperature in the form of a table showing temperature in Celsius,estimated temperature in Fahrenheit and actualtemperature in Fahrenheit.

#define F_LOW 0 
#define F_MAX 250 
#define STEP 25 
main()
{
    typedef float REAL ; 
    REAL celsius, efahrenheit, afahrenheit; 
    celsius = F_LOW ; 
    printf("celsius       Estimated Temp in Fahrenheit      Actual Temp in Fahrenheit   \n  \n  \n") ;
    while( celsius <= F_MAX )
    {
        efahrenheit = ( celsius * 1.8)+ 32.0;
        afahrenheit = ( celsius * 1.8) +32.0;
        printf("%-2.1f       %-10.2f           %-22.2f  \n", celsius, efahrenheit, afahrenheit);
        celsius = celsius + STEP ;
        getchar();
    }
}

Recommended Answers

All 2 Replies

So...what output does the program produce and how is that not what you want?

try beginning first with 1 value
and then go for ten or more
with the while loop.
first read the value in celsius, also the simple scanf, no?
then convert, saving the two variables,
and then print the output. :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.