I'm working on the book "programming in objective c 2.0" and im not understanding why this program is not working. basically i need to build a program to convert a fahrenheit value to a celcius one.
I figured to just solve it very simply without objects and just use a straight procedural methodology, any way the problem I'm having is that the values of the variables I define to represent the fahrenheit or celcius values are coming up kind of random.
Here's my code:
#import <Foundation/Foundation.h>
int main (int argc, const char * argv[]) {
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
float fahrenheit;
float celciusConverted;
fahrenheit = 27.0;
celciusConverted = ( fahrenheit - 32 ) / 1.8 ;
NSLog(@"%f degrees fahrenheit is equal to %f degrees celcius") , fahrenheit, celciusConverted;
[pool drain];
return 0;
}