• Source
    1. #import <objc/objc.h>
    2. #import <objc/Object.h>
    3. #import <Foundation/Foundation.h>
    4.  
    5. @interface TestObj : Object
    6. {
    7. //none
    8. }
    9. - (void)testMethod;
    10. @end
    11.  
    12. @implementation TestObj
    13. - (void)testMethod {
    14. //declare two NSInteger variables
    15. NSInteger var1,var2;
    16.  
    17. //scanf("%d,%d",var1,var2);
    18. //assume that user enters 1 and 2
    19. var1=1; var2=2;
    20.  
    21. //printing a formatted output of the result of adding integer values
    22. printf("%d", (var1 * var2));
    23. }
    24.  
    25. int main()
    26. {
    27. id obj = [[TestObj alloc] init];
    28. [obj testMethod];
    29. return 0;
    30. }
    31. @end