Tuesday - Week 1

  • Uploaded by: William Smith
  • 0
  • 0
  • May 2020
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View Tuesday - Week 1 as PDF for free.

More details

  • Words: 203
  • Pages: 12
Our First Program!!! #import int main (int argc, const char * argv[]) { NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; NSLog (@"Programming is fun!"); [pool drain]; return 0; }

#import int main (int argc, const char *argv[]) { NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; NSLog (@"Testing...\n..1\n...2\n....3"); [pool drain]; return 0; }

#import int main (int argc, const char *argv[]) { NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; int sum; sum = 50 + 25; NSLog (@"The sum of 50 and 25 is %i", sum); [pool drain]; return 0; }

#import int main (int argc, const char *argv[]) { NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; int value1, value2, sum; value1 = 50; value2 = 25; sum = value1 + value2; NSLog (@"The sum of %i and %i is %i", value1, value2, sum); [pool drain]; return 0; }

#import int main (int argc, const char *argv[]) { NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; int answer, result; answer = 100; result = answer - 10; NSLog (@"The result is %i\n", result + 5); [pool drain]; return 0; }

Write a program that subtracts the value 15 from 87 and displays the results with an appropriate message.

Tonight's Lab

Related Documents


More Documents from "William Smith"