Click here to Skip to main content
16,005,206 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
When i run this code , im getting :

Exception in thread "main" java.lang.Error: Unresolved compilation problem: 
	Syntax error, insert ";" to complete Statement

	at practicebook.sum1.main(sum1.java:86)


for the line :

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


What I have tried:

************************************************************************************************************************************************************************************
Posted
Updated 13-Feb-17 12:06pm

1 solution

This
Java
/

and
Java
*/

should not be in this code.
 
Share this answer
 
Comments
ali_heidari_ 13-Feb-17 18:47pm    
Correct!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900