+ 3
Not getting the problem in my code....need help plz
kindly provide the solution https://code.sololearn.com/c4SkFT8434pp/?ref=app
5 odpowiedzi
+ 14
The display method needs to be closed with a curly brace }
+ 7
1.Forget Bracket
2.Unknown character which is invisible inside
+ 5
You would better see this kind of mistake by better indenting/spacing your code:
import java.util.Scanner;
public class Program
{
    public void display() {
        Scanner sc=new Scanner(System.in);
        int r;
        int n;
        System.out.println(" Enter a no.");
        n = sc.nextInt();
        while (n!=0)
        {
           r=n%10;
           n=n/10;
           System.out.println(r);
        }
    }
 
   public static void main (String args[]) {
        Program obj =new Program();
        obj.display();
    }
}
+ 3
You forgot to close method display }
+ 3
thanks a lot everyone☺



