Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Simple Arithmetic Operations in Objective C
Language:
Ada
Assembly
Bash
C#
C++ (gcc)
C++ (clang)
C++ (vc++)
C (gcc)
C (clang)
C (vc)
Client Side
Clojure
Common Lisp
D
Elixir
Erlang
F#
Fortran
Go
Haskell
Java
Javascript
Kotlin
Lua
MySql
Node.js
Ocaml
Octave
Objective-C
Oracle
Pascal
Perl
Php
PostgreSQL
Prolog
Python
Python 3
R
Rust
Ruby
Scala
Scheme
Sql Server
Swift
Tcl
Visual Basic
Layout:
Vertical
Horizontal
//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; }
gcc
Show compiler warnings
[
+
] Compiler args
[
+
]
Show input
Compilation time: 0.33 sec, absolute running time: 0.1 sec, cpu time: 0.05 sec, memory peak: 9 Mb, absolute service time: 0,44 sec
edit mode
|
history
|
discussion