以下程序通过使用布尔逻辑运算符实现运算。程序代码如下:
2015-01-18 12:29:40.848 Sample.3.7[1119:79147] Hello, This is a sample 3.7 of the book 《iOS7 开发快速入门》!
2015-01-18 12:29:40.849 Sample.3.7[1119:79147] 0
Program ended with exit code: 0
#import <Foundation/Foundation.h>
int main(int argc, const char * argv[]) {
@autoreleasepool {
// insert code here...
NSLog(@"Hello, This is a sample 3.7 of the book 《iOS7 开发快速入门》!");
NSLog(@"%i",(3<4)&&(0==1));
}
return 0;
}
运行结果如下:
2015-01-18 12:29:40.848 Sample.3.7[1119:79147] Hello, This is a sample 3.7 of the book 《iOS7 开发快速入门》!
2015-01-18 12:29:40.849 Sample.3.7[1119:79147] 0
Program ended with exit code: 0