#import // allows use of NSLog from Apple's Cocoa environment int main (int argc, const char * argv[]) { NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; NSLog(@"hello world"); NSLog(@""); NSLog(@"first line\nsecond line"); NSLog(@"escape sequences: \\ \""); int num = 1; NSLog(@"%d", num); NSLog(@"num = %d", num); float price = 19.999; NSLog(@"price = $%f", price); int x = 123456; NSLog(@"%2d", x); NSLog(@"%4d", x); NSLog(@"%6d", x); NSLog(@"%8d", x); float y = 1234.5678; NSLog(@"Reserve a space of 10, and show 2 significant digits."); NSLog(@"%10.2f", y); int z = 8; float pi = 3.1416; NSLog(@"The integer value is %d, whereas the float value is %f.", z, pi); [pool release]; return 0; }// end of main