Sha256: 964ad391272b456720217abcf1f0bb501ad596908c32dac2de7e67f139b96d91

Contents?: true

Size: 448 Bytes

Versions: 10

Compression:

Stored size: 448 Bytes

Contents

# Maybe you need to import the mathematical funcions 
# from Tcl with:
# eval("namespace path ::tcl::mathfunc");

void main() {
    int a, b; 
    puts("Enter two integers:");
    a = (int)(gets(stdin)); 
    b = (int)(gets(stdin)); 
    puts("${a} + ${b} = ${a+b}");
    puts("${a} - ${b} = ${a-b}");
    puts("${a} * ${b} = ${a*b}");
    puts("${a} / ${b} = ${a/b}, remainder ${a%b}");
    puts("${a} to the power of ${b} = ${(int)pow(a,b)}");
}

Version data entries

10 entries across 7 versions & 1 rubygems

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