Exception in thread "main" java.lang.Error: Unresolved compilation problem: Syntax error, insert ";" to complete Statement at practicebook.sum1.main(sum1.java:86)
System.out.printf("Sum of %s's odd digits: %f", number, odd_digits_sum);
/ import java.util.Scanner; public class sum1 { public static void main(String[] args) { Scanner input = new Scanner(System.in); System.out.print("Number: "); int number = input.nextInt(); input.close(); int odd_digits_sum = 0; while (number > 0) { int digit = number % 10; if (digit % 2 != 0) { odd_digits_sum += digit; } number /= 10; } System.out.printf("Sum of %s's odd digits: %f", number, odd_digits_sum); */ } } //end main} // end class
/
*/
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)