#import <objc/objc.h>
#import <objc/Object.h>
#import <Foundation/Foundation.h>
@interface TestObj : Object
{
//none
}
- (void)testMethod;
@end
@implementation TestObj
- (void)testMethod {
//declare two float variables
float var1,var2;
//scanf("%f,%f",var1,var2);
//assumption
//var1=1.0; var2=0.0;
var1=1.0; var2=2.0;
if (var2==0){
//error
printf("%s","Error. Division by zero."); }
else {
//printing a formatted output of the result of dividing float value
}
}
int main()
{
id obj = [[TestObj alloc] init];
[obj testMethod];
return 0;
}
@end