Amazon.com Widgets Exercise 2 Very Easy Solution
Welcome, Guest. Please login or register.
Did you miss your activation email?
June 19, 2013, 07:32:15 PM
Home Help Search chat Login Register   
News: Read this please.The Great Kangaroo Escape Looking for reviews of the 4th ed on Amazon!   Twitter:  @skochan
                     

+  Official Forum for Programming in Objective-C (the iPhone Programming Language) - Stephen Kochan
|-+  Old Stuff
| |-+  Answers to Exercises
| | |-+  Chapter 4
| | | |-+  Exercise 2 Very Easy Solution
Pages: [1]   Go Down
Print
Author Topic: Exercise 2 Very Easy Solution  (Read 441 times)
klamse
Newbie
*
Posts: 11


Email




« on: June 21, 2011, 07:20:47 PM »

Code: (Objective-C)

#import <Foundation/Foundation.h>

int main (int argc, const char * argv[])
{

    NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
   
    // C = (F - 32) / 1.8
    // Write a program that converts  27 F to degrees C
   
   double  F = 27;
   
   double C = (F - 32) / 1.8;
   
    NSLog(@"%f degrees F is equal to %f C", F, C);

   
    [pool drain];
    return 0;
}

Logged
Pages: [1]   Go Up
Print
Jump to:  



Login with username, password and session length

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!
Entire forum contents (c) 2009 classroomM.com. All rights reserved.