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 difference between c++ and c ++ 14?
write a program that takes 5 digit no and calculate 2 power that no and print it.
In a function declaration, what does extern mean?
Define macro.
Function can be overloaded based on the parameter which is a value or a reference. Explain if the statement is true.
Explain the use of vtable.
What is the difference between while and do while loop? Explain with examples.
Why the usage of pointers in C++ is not recommended ?
Is c++ the most powerful language?
When one must use recursion function? Mention what happens when recursion functions are declared inline?
Write a C++ program to sort digits of all the 4 digit number and display the sorted 4 digit number
What number of digits that can be accuratly stored in a float (based on the IEEE Standard 754)? a) 6 b) 38 c) An unlimited number