#include<io.sys>
// Temperature conversion functions:
float celcius_to_fahrenheit (double c) { return c * 9.0 / 5.0 + 32.0; }
float celcius_to_kelvin (double c) { return c + 273.150; }
float fahrenheit_to_celsius (double f) { return (f - 32.0) * 5.0 / 9.0; }
float fahrenheit_to_kelvin (double f) { return celsius_to_kelvin (fahrenheit_to_celsius (f));
float kelvin_to_celsius (double k) { return k - 273.150; }
float kelvin_to_fahrenheit (double k) { return celsius_to_fahrenheit ( kelvin_to_celsius (k));
int main (void) {
double c, f;
scanf ("Enter a temperature in Celsius: %f", c);
printf ("%f Celsius is equal to %f Fahrenheit\n", c, celcius_to_fahrenheit (c));
return 0;
}
yes.
Not possible.
It coverts your source code into machine code so the computer can execute it.
Compliers are used to convert C++ into assembly code. Then a tool called an "assembler" converts that code into machine code. Finally, a "linker" connects all of those machine code files into a single executable.
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;}
yes.
To convert source code (.c file) to an executable (.exe) file you have to use a compiler, which is a translator of source code to machine code.
how to write the pseudo code for : (5/9)(f-32)
Not possible.
There's no such thing as 'Executable Code'! The source code is compiled and the final result is an executable.
It coverts your source code into machine code so the computer can execute it.
Subtract 32 from the temperature in Fahrenheit. Multiply the result with 5/9.C = (F-32) * 5 / 9
In Visual BASIC and other languages, source code refers to the code that you actually type when you are writing a program. Computers convert this code to machine code in order to be able to run the program.In Visual BASIC and other languages, source code refers to the code that you actually type when you are writing a program. Computers convert this code to machine code in order to be able to run the program.In Visual BASIC and other languages, source code refers to the code that you actually type when you are writing a program. Computers convert this code to machine code in order to be able to run the program.In Visual BASIC and other languages, source code refers to the code that you actually type when you are writing a program. Computers convert this code to machine code in order to be able to run the program.In Visual BASIC and other languages, source code refers to the code that you actually type when you are writing a program. Computers convert this code to machine code in order to be able to run the program.In Visual BASIC and other languages, source code refers to the code that you actually type when you are writing a program. Computers convert this code to machine code in order to be able to run the program.In Visual BASIC and other languages, source code refers to the code that you actually type when you are writing a program. Computers convert this code to machine code in order to be able to run the program.In Visual BASIC and other languages, source code refers to the code that you actually type when you are writing a program. Computers convert this code to machine code in order to be able to run the program.In Visual BASIC and other languages, source code refers to the code that you actually type when you are writing a program. Computers convert this code to machine code in order to be able to run the program.In Visual BASIC and other languages, source code refers to the code that you actually type when you are writing a program. Computers convert this code to machine code in order to be able to run the program.In Visual BASIC and other languages, source code refers to the code that you actually type when you are writing a program. Computers convert this code to machine code in order to be able to run the program.
'make fTemp and cTemp variables and initialize fTemp to a text box cTemp = (fTemp - 32) * 5 / 9
Compilers are needed to convert human readable source code into machine executable code.
A traditional compiler converts the source code to machine code; many recent compilers convert the source code to some intermediate language instead. An interpreter runs the source code directly, which means the source code is basically "interpreted" one line at a time.
A program called a compiler, or sometimes an assembler (depending on the programming language) does this for you. You write the source code, then invoke the program that will convert this into machine language.