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 |
Is it possible to use a new for the reallocation of pointers ?
Incase of a function declaration, what is extern means?
Why is the function main() special?
What are Virtual Functions? How to implement virtual functions in "C" ?
Define a conversion constructor?
Distinguish between a # include and #define.
How do you master coding?
What are the four main data types?
I want explanation for this assignment: how to connect mysql database using c/c++,please explain this detailly?
Why is c++ not purely object oriented?
What are c++ storage classes?
What is the maximum combined length of command line arguments including the space between adjacent arguments?