How to add two numbers in Objective-C

1 Answer

0 votes
#import <Foundation/Foundation.h>

int main (int argc, const char *argv[]) {
    NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];

    int x = 10;
    int y = 25;
    NSLog(@"x + y = %i", (x+y));

    [pool drain];
    return 0;
}



/*
run:

x + y = 35

*/

 



answered Dec 11, 2022 by avibootz
edited Dec 11, 2022 by avibootz

Related questions

...