For this Question: Given a number N. Your task is to change the given number into into Binary form.The input contains a single integer N.

Constraints:-
1 <= N <= 1000Print the Binary form of the given number N.Sample Input:-
8

Sample Output:-
1000

Sample Input:-
15

Sample Output:-
1111, I have written this Solution Code: 
import java.util.*;
import java.lang.*;
import java.io.*;

class Main
{
	public static void main (String[] args) throws java.lang.Exception
	{
		Scanner sc = new Scanner(System.in);
	    
		long n=sc.nextLong();
		long ans=0;
		long p=1;
		while(n>0){
		    ans+=(n%2)*p;
		    p*=10;
		    n/=2;
		}
		System.out.print(ans);
	}



}, In this Programming Language: Java, Now tell me if this Code is compilable or not?