write the programme that convert a interger to biniry number
import java.util.Scanner;
public class HelloWorld{
public static void main(String []args){
Scanner scr=new Scanner(System.in);
int no,i=0,a=0;
int [] x=new int[20];
System.out.println("Enter the decimal number");
no=scr.nextInt();
while(no!=0)
{
a=no%2;
no=no/2;
x[i]=a;
i++;
}
int len=i;
for(i=len-1;i>=0;i--)
{
System.out.print(""+x[i]);
}
}
}
| Is This Answer Correct ? | 0 Yes | 0 No |
What is c++ and its features?
What is split a string in c++?
What is a try block?
How to construct muliton object
Explain the advantages of using friend classes.
What is switch case in c++ syntax?
What is a class template in c++?
What is format for defining a structure?
What are c++ variables?
Define a pdb file.
Explain the concept of memory leak?
What is std::move?