#import int main(int argc, const char * argv[]) { @autoreleasepool { // insert code here... NSLog(@"Hello, World!"); // Print out something NSLog(@"This is a testing"); NSLog(@"THIS IS ANOTHER TESTING"); int k1 = 100; int k2 = 200; int sum = k1 + k2; NSLog(@"The sum is %i",sum); float k3 = 400; float k4 = 500; NSLog(@"The sum is %3.2f",k3+k4); // For Loop for (int i=0; i<5; i++) { NSLog(@"The number is %i",i); if(i == 2) { NSLog(@"Matching number 2"); } } // While Loop int j = 0; while (j<5) { NSLog(@"The num is %i",j); j++; } // Normal Variable // Normal variable contains the actual value int myvar = 10; // Pointer Variable // Pointer variable contains the memory address of the variable // Define a pointer variable without value. int *myptr; // Store the address of "myvar" variable into "myptr" variable myptr = &myvar; // Print out the content of myvar, which is the actual value NSLog(@"myvar is %i",myvar); // Print out the content of myptr, which is the address of myvar NSLog(@"myptr is %d",myptr); // Get the content contained in the address and then add 30 to it and save back *myptr = *myptr + 30; NSLog(@"myvar is %i",myvar); // NSString NSString *myname = [[NSString alloc]initWithFormat:@"Peter Wong"]; NSLog(@"My name is %@",myname); } return 0; }