Hi guys,
I am working on a program that will convert the Fahrenheit value taken and returning a celsius.
We have to use a user defined function to calculate. The program doesn't work ofcourse.
Code:
#include <stdio.h>
float Fahrenheit_to_Celsius();
void main()
{
float fahren;
printf ("Please enter a Fahrenheit value:");
scanf ("%.1f", &fahren);
Fahrenheit_to_Celsius();
{
float celsius, fahren;
celsius=5*(fahren-32.0)/9;
return celsius;
}
printf("%.1f degrees Fahrenheit is %.1f degrees Celsius", fahren, celsius);
}
I have a question too. I have seen my teacher writing the user defined fuction like this:
Code:
void calculate(int dice1, int dice2);
so did he just declared the variables in the fuction?. So will this be a local variable or a global variable?. Sorry I am little confused with fuctions again .
thanks for any help