package methodoverloading; /** * * @author stephenwessels */ import java.util.Scanner; public class MethodOverloading { static int i; static int j; public static int GetSum(int a) { i = 234; j = 0; while (i != 0) { j += i % 10; i /= 10; } return i + j; } /** * @param args the command line arguments */ public static void main(String[] args) { Scanner in = new Scanner(System.in); System.out.println("Enter two three-digit numbers"); i = in.nextInt(); j = in.nextInt(); System.out.println("The sum of the digits is " + GetSum(i)); } }
234
GetSum
a
i = 234;
i = a;
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)