Hi, i am a beginner in java and i need some help.
my program should take 2 integers and find their range and output the biggest number(sum of his chars)
btw i dont have compile error but after i put the integer nothing come out from my methods.
sorry for my bad english and thanks for any help
String number1=JOptionPane.showInputDialog(null,"enter first number"); int intnum1=Integer.parseInt(number1); String number2=JOptionPane.showInputDialog(null,"enter second number"); int intnum2=Integer.parseInt(number2); JOptionPane.showMessageDialog(null,"the sum of the biggest number is"+range(intnum1,intnum2)); } public static int range(int num1,int num2) { int l=0; if (num1>num2) { int temp=num2; num2=num1; num1=temp;} for (int i=num1;num1<=num2;i++){ int sum=0; while (i!=0) { sum+=i%10; i=i/10; } l=m(sum); }return l;} public static int m(int sum){ int count=0; if (sum>=count) count=sum; return count;}