Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Sum{
- public int GetSum(int a, int b){
- //Good luck!
- int sum = 0;
- if (a==b){
- return a;
- }// close if
- else{
- for (int i=b; i<=a;i++){
- sum+=i;
- }// close else
- } // close for loop
- return sum;
- } // closee GetSum
- } // close class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement