Quantcast
Channel: Programming Forums
Viewing all articles
Browse latest Browse all 51036

What is wrong with my local header to make it not work?

$
0
0
#include <stdio.h>
#include <math.h>
#include <conio.h>
#include "Celsius.h"

int main()
{
	float x;

	printf("Enter the degrees Fahrenheit you wish to convert to Celsius: ");
	scanf("%f", &x);

	Celsius(x);

	getch();
	return(0);
}

And here is Celsius.h code:
#include <stdio.h>


void Celsius(float F)
{
	float C;
	
	C = ((F - 32) * (5 / 9));

	printf("%.2f degrees Fahrenheit is the same as %.2f degrees Celsius!\n", F, C);
	
}


I am stumped. I don't see what is wrong nor can the internet tell me what is wrong with this. It tells me:
"(correct number) degrees Fahrenheit is the same as -0.00 degrees Celsius." Celsius is ALWAYS -0.00 degrees... haha I just don't see the error here... I feel so close and it is probably something silly... or maybe I did something completely wrong? I don't know...

Viewing all articles
Browse latest Browse all 51036

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>