Exercises
1. Type in and run the five programs presented in this chapter. Compare the output produced by each program with the output presented after each program.
2. Write a program that displays the following text:
In Objective-C, lowercase letters are significant.main is where program execution begins.Open and closed braces enclose program statements in a routine.All program statements must be terminated by a semicolon.
3. What output would you expect from the following program?
#import <Foundation/Foundation.h>int main (int argc, const char * argv[]){ @autoreleasepool { int i; i = 1; NSLog (@"Testing..."); NSLog (@"....%i", i); NSLog (@"...%i", i + 1); NSLog (@"..%i", i + 2); } return 0;}
4. Write a program ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access