A+B: Difference between revisions

475 bytes added ,  8 years ago
(→‎{{header|Potion}}: Clarified documentation)
Line 158:
[[File:Num.png|left|aplusb]]
<br clear=both>
 
=={{header|APEX}}==
<lang Java>
static Integer sumOfTwoNums(Integer A, Integer B) {
return A + B;
}
 
System.debug('A = 50 and B = 25: ' + sumOfTwoNums(50, 25));
System.debug('A = -50 and B = 25: ' +sumOfTwoNums(-50, 25));
System.debug('A = -50 and B = -25: ' +sumOfTwoNums(-50, -25));
System.debug('A = 50 and B = -25: ' +sumOfTwoNums(50, -25));
 
{{out}}
<pre>
A = 50 and B = 25: 75
A = -50 and B = 25: -25
A = -50 and B = -25: -75
A = 50 and B = -25: 25
</pre>
</lang>