Advertisement
danzylrabago

CheckSum

Mar 26th, 2020
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. using System;
  2. class Exercise1
  3. {
  4.  
  5. public static int test(int num1, int num2)
  6. {
  7. int check = -1;
  8. int sum = num1 + num2;
  9. if(sum < 100) // comparing if sum is less than 100
  10. {
  11. check = 0;
  12. }
  13. else if( sum == 100)
  14. {
  15. check = 2;
  16. }
  17. else
  18. {
  19. check = 1;
  20. }
  21. return check;
  22. }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement