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 the standard template library (stl)?
Which software is best for coding?
How to create a reference variable in C++
What is pair in c++?
Why c++ is created?
Explain differences between alloc() and free()?
If dog is a friend of boy and boy is a friend of house, is dog a friend of house?
What issue do auto_ptr objects address?
List the special characteristics of constructor.
What is scope in c++ with example?
Which algorithm do you like the most? Why?
Write some differences between an external iterator and an internal iterator? Describe the advantage of an external iterator.