answersLogoWhite

0

Here's a simple function that will convert Fahrenheit to Celsius for you:

function toCelsius(fahrenheit:Number):Number{

var celsius:Number = (fahrenheit - 32) * (5/9);

return celsius;

}

Use:

// Converts 60 degrees Fahrenheit to Celsius

var newTemperature:Number = toCelsius(60);

trace(newTemperature);

User Avatar

Wiki User

15y ago

What else can I help you with?

Continue Learning about Engineering

Write a QBASIC program to convert a temperature in degrees Fahrenheit to degrees Celsius or vice versa depending on input?

CLS INPUT "Enter degrees in Celsius:";c INPUT "Enter degrees in Fahrenheit:";f a=(c*1.8)+32 b=5/9(f-32) PRINT c;"degree Celsius=" a;"degree Fahrenheit" PRINT f;"degree Fahrenheit=" b;"degree Celsius" end


C progamme for conversion of Celsius to Fahrenheit using array?

main void void void (void) { float temp1 [13]= {1,4,2,3,4,5,7,88,9,4,3,23,12};


How do you write a program in C to convert temperatures between Fahrenheit and Celsius?

Code Example:/********************************************************************************* MODULE: main.c******************************************************************************** DESCRIPTION:* Program that takes a temperature from the user on the command line, then* displays that temperature as celsius converted to Fahrenheit, and* as Fahrenheit converted to celsius.********************************************************************************/#include #define iARGS_REQUIRED 2#define iARG_EXE 0#define iARG_INPUT 1static floatfCelsiusToFahrenheit( float fCelsius );static floatfFahrenheitToCelsius( float fFahrenheit );/********************************************************************************* MAIN********************************************************************************/intmain( int iArgc, char *acpArgv[] ){ float fFahrenheit = 0.0; float fCelsius = 0.0; float fInput = 0.0; /* user didn't provide a temperature on the command line */ if(iArgc != iARGS_REQUIRED) { fprintf(stderr, "Usage: %s [temperature]\n", acpArgv[iARG_EXE]); return 0; } /* read the given temperature into the fInput variable */ sscanf(acpArgv[iARG_INPUT], "%f", &fInput); /* fInput treated as celsius and converted to Fahrenheit */ fFahrenheit = fCelsiusToFahrenheit(fInput); /* fInput treated as Fahrenheit and converted to celsius */ fCelsius = fFahrenheitToCelsius(fInput); printf( "%.2f degrees Fahrenheit is %.2f degrees celsius.\n", fInput, fCelsius ); printf( "%.2f degrees celsius is %.2f degrees Fahrenheit.\n", fInput, fFahrenheit ); return 0;}/********************************************************************************* STATIC FUNCTION: fCelsiusToFahrenheit******************************************************************************** DESCRIPTION:* Converts a celsius temperature to Fahrenheit.** PARAMETERS:* fCelsius: The temperature in celsius to convert.** RETURNS:* fCelsius converted to Fahrenheit.********************************************************************************/static floatfCelsiusToFahrenheit( float fCelsius ){ return (fCelsius * 1.8) + 32;}/********************************************************************************* STATIC FUNCTION: fFahrenheitToCelsius******************************************************************************** DESCRIPTION:* Converts a Fahrenheit temperature to celsius.** PARAMETERS:* fFahrenheit: The temperature in Fahrenheit to convert.** RETURNS:* fFahrenheit converted to celsius.********************************************************************************/static floatfFahrenheitToCelsius( float fFahrenheit ){ return (fFahrenheit - 32) / 1.8;}


How do you convert Encryption to base64 decryption using asp?

how to convert encryption to decryption using VB


What is a sentence using the word convert as a verb?

Heat is used to convert water to vapor.

Related Questions

If it is twenty degrees Celsius what is it in Fahrenheit?

It is 68 degrees Fahrenheit. You can convert Celsius to Fahrenheit by using the formula: Fahrenheit = (Celsius * 9/5) + 32.


Can you convert 37.4 Celsius to Fahrenheit?

Of course your can! You can convert any temperature from Celsius to Fahrenheit and vise versa. 37.4°C=99.32°F.


What is 451 Fahrenheit in Celsius?

451 degrees Fahrenheit is equal to approximately 232.78 degrees Celsius. You can convert Fahrenheit to Celsius using the formula: Celsius = (Fahrenheit - 32) * 5/9.


What is 116 deg celsius to Fahrenheit?

116 degrees Celsius is equal to 240.8 degrees Fahrenheit. You can convert Celsius to Fahrenheit using the formula: (Celsius × 9/5) + 32 = Fahrenheit.


How do you convert degrees Celsius or Fahrenheit to Kelvin?

To convert Celsius to Kelvin:K = C + 273.15To convert Fahrenheit to Kelvin, convert Fahrenheit to Celsius by using this formula:C = (F - 32)/1.8Then, convert it to Kelvin by using the previous formula, adding 273.15 to the Celsius value.To convert the Celsius to Kelvin, you just add 273.15Kelvin does not use the º symbol.


29 Fahrenheit is equal to what in Celsius?

29 degrees Fahrenheit = -1.6 degrees Celsius.


What formula is converted from Celsius to Fahrenheit?

you can convert using this formula where (F) is the Fahrenheit you want to get and (C) is the Celsius you want to convert from


Convert 31.8 degree Fahrenheit to celsius?

Start by taking the number in Fahrenheit and subtracting 32. Then divide the number by 9, and then multiply it by 5. This is how you convert Fahrenheit to Celsius or use the equation C = (F - 32) × 5/9In this case, the answer is about -0.1111 degrees Celsius.


How many kelvins is 27000000 Fahrenheit?

To convert Fahrenheit to Kelvin, you first need to convert Fahrenheit to Celsius using the formula: Celsius = (Fahrenheit - 32) * 5/9. Then, you convert Celsius to Kelvin by adding 273.15. Therefore, 27000000 Fahrenheit is approximately 14999953.15 Kelvin.


What is -12 degrees Fahrenheit to Celsius?

-12 degrees Fahrenheit is approximately -24.4 degrees Celsius. You can convert Fahrenheit to Celsius using the formula: (Fahrenheit - 32) x 5/9.


How does one convert Celsius to Fahrenheit?

A person can convert Celsius to Fahrenheit by either using a simple equation or by using an online calculator that will complete the conversion. The equation is F = (C x 1.8) + 32.


What is 1425 degrees Celsius in Fahrenheit?

1425 degrees Celsius is equal to approximately 2597 degrees Fahrenheit. You can convert Celsius to Fahrenheit using the formula: (Celsius * 9/5) + 32.