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 insertion sorting?
When there is a global variable and local variable with the same name, how will you access the global variable?
Where is atoi defined?
Please explain class & object in c++?
Explain the isa and hasa class relationships.
What does catch(…) mean?
What are manipulators used for?
To which numbering system can the binary number 1101100100111100 be easily converted to?
Why c++ is so important?
Given a simple program designed to take inputs of integers from 1-1000 and to output the factorial value of that number, how would you test this program? You do not have access to the code. Please be as specific as possible.
What are separators in c++?
What is a base class?