1. Omitted
2.
#import <Foundation/Foundation.h>int main(int argc, const char * argv[]){ @autoreleasepool { // insert code here... NSLog(@"In Obiective-c, lowercase letters are significance .\n main is where program execution begins.\n Open and closed brace enclose program stateme nts in a routine .\n All program statements must be terminated by a semicolon .");
}
Return 0;
}
3.
Testing...
... 1
... 2
.. 3
4.
int value1, value2, sum;
value1 = 87; value2 = 15; sum = value1 - value2; NSLog(@"sum is %i", sum);
5. Procedures after correction
Int sum; <--- the original int is changed to int.
/* Compute result */<--- comments on the right of the original text // change */. sum = 25 + 37-19; <--- end with a semicolon after the original text. /* Display Results */<--- change the original comment /*.. * // or //. nslog (@ "The answer is % I", sum); <--- replace the original text with double quotation marks, and add a comma before sum.
6.
The result is 95.
End
Objective-C Programming (Sixth Edition) Chapter 2 Exercise answers