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 |
Difference between pass by value and pass by reference?
What is a reference in C++?
What do you know about friend class and friend function?
Describe the syntax of single inheritance in C++?
Ask to write virtual base class code?
What is #include sstream?
Explain the concept of copy constructor?
Declare a class vehicle and make it an abstract data type.
I need to find a specific string between two strings how do I do it?
Give an example of run-time polymorphism/virtual functions.
What is a base class?
What is optimization in c++? when using volatile.optimization is not possible..what does this mean?