Arithmetic/Integer: Difference between revisions

Content added Content deleted
Line 4,090: Line 4,090:
20 % 4 => 0
20 % 4 => 0
20 ** 4 => 160000</pre>
20 ** 4 => 160000</pre>

== Python 3.x Long Form ==
<lang python>input1 = 18
# input1 = input()
input2 = 7
# input2 = input()

qq = input1 + input2
print("Sum: " + str(qq))
ww = input1 - input2
print("Difference: " + str(ww))
ee = input1 * input2
print("Product: " + str(ee))
rr = input1 / input2
print("Integer quotient: " + str(int(rr)))
print("Float quotient: " + str(float(rr)))
tt = float(input1 / input2)
uu = (int(tt) - float(tt))*-10
#print(tt)
print("Whole Remainder: " + str(int(uu)))
print("Actual Remainder: " + str(uu))
yy = input1 ** input2
print("Exponentiation: " + str(yy))</lang>

{{Out}}
<pre>Sum: 25
Difference: 11
Product: 126
Integer quotient: 2
Float quotient: 2.5714285714285716
Whole Remainder: 5
Actual Remainder: 5.714285714285716
Exponentiation: 612220032</pre>


=={{header|QB64}}==
=={{header|QB64}}==