Sha256: 7174e5f61df82d24b43ad96dd5bf3134c235db2e69aaf3f0899ce0d0add69c8a

Contents?: true

Size: 424 Bytes

Versions: 10

Compression:

Stored size: 424 Bytes

Contents

module arith;

extern printf;
extern scanf;

@Integer main [
	@Pointer<@Integer> a = alloc(4);
	@Pointer<@Integer> b = alloc(4);
	scanf("%i %i", a, b);
	
	printf("a + b = %i\n", a::get + b::get);
	printf("a - b = %i\n", a::get - b::get);
	printf("a * b = %i\n", a::get * b::get);
	printf("a / b = %i\n", a::get / b::get);
	printf("a % b = %i\n", a::get % b::get);
	printf("a ** b = %i\n", a::get ** b::get);
	
	return 0;
]

Version data entries

10 entries across 7 versions & 1 rubygems

Version Path
zettacode-0.1.7 files.zettacode/arithmetic.integer/phl.txt
zettacode-0.1.6 files.zettacode/arithmetic.integer/phl.txt
zettacode-0.1.6 files.zettacode2/arithmetic.integer/phl.txt
zettacode-0.1.5 files.zettacode/arithmetic.integer/phl.txt
zettacode-0.1.5 files.zettacode2/arithmetic.integer/phl.txt
zettacode-0.1.4 files.zettacode/arithmetic.integer/phl.txt
zettacode-0.1.4 files.zettacode2/arithmetic.integer/phl.txt
zettacode-0.1.3 files.zettacode/arithmetic.integer/phl.txt
zettacode-0.1.2 files.zettacode/arithmetic.integer/phl.txt
zettacode-0.1.1 zettacode.files/arithmetic.integer/phl.txt