Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Simple Arithmetic Operations in Objective C
//gcc 5.0.4 #import <Foundation/Foundation.h> @interface FrstCode:NSObject - (void)add; - (void)sub; - (void)mul; - (void)div; @end @implementation FrstCode float a=10.23, b=20.14, c; - (void)add { c = a + b; NSLog(@"%f + %f = %f",a,b,c); } - (void)sub { c = a - b; NSLog(@"%f - %f = %f",a,b,c); } - (void)mul { c = a * b; NSLog(@"%f * %f = %f",a,b,c); } - (void)div { c = a / b; NSLog(@"%f / %f = %f",a,b,c); } @end int main (int argc, const char * argv[]) { NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; //NSLog (@"Hello, World!"); FrstCode *frstCode = [[FrstCode alloc]init]; [frstCode add]; [frstCode sub]; [frstCode mul]; [frstCode div]; return 0; }
run
|
edit
|
history
|
help
0
string search
HAL is IBM
Goldbach Conjecture
basic arithmatic Opreation in objective C
Convert String to NSData Json Object
BookAuther
01 Hola mundo
string type cast
PRogram 3.2 - simple class
Strings