This above code is correct. This will show result in third textbox.
If you want to show result in UIAlertView
Try UIAlertView
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Result !!" message:[NSString stringWithFormat:@"%d", result]; delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil];
// optional - add more buttons:
[alert addButtonWithTitle:@"Yes"];
[alert show];
And don't forget to add UIAlertViewDelegate
in .h class