fork(1) download
  1. #import <Foundation/Foundation.h>
  2.  
  3. @interface Math:NSObject
  4. +( int ) max: ( int ) a B: ( int ) b;
  5. @end
  6.  
  7. @implementation Math
  8. +( int ) max: ( int ) a B: ( int ) b {
  9. int result = a;
  10. if( b > a )
  11. result = b;
  12. return result;
  13. }
  14. @end
  15.  
  16. int main(int argc, const char * argv[]) {
  17.  
  18. NSAutoreleasePool *pool = [NSAutoreleasePool new];
  19. int a = 10, b = 120;
  20. NSLog( @"Max value between ( %d, %d ) is: %d\n",
  21. a, b, [ Math max: a B: b ] );
  22. [pool drain];
  23.  
  24. return 0;
  25. }
Success #stdin #stdout #stderr 0.04s 42848KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
2016-05-02 11:41:29.606 prog[14166] Max value between ( 10, 120 ) is: 120