RosettaCodeData/Task/Arithmetic-Integer/Little/arithmetic-integer.little
2023-07-01 13:44:08 -04:00

15 lines
444 B
Text

# 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)}");
}