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 |
How would perform Pattern Matching in C++?
What is class invariant in c++?
Is C++ case sensitive a) False b) Depends on implementation c) True
Explain object slicing in c++?
Incase of a function declaration, what is extern means?
what are the events occur in intr activated on interrupt vector table
What is long in c++?
Explain the differences between private, public and protected and give examples.
Write about all the implicit member functions of a class?
What is c strings syntax?
What is the role of copy constructor in copying of thrown objects?
What is the average salary of a c++ programmer?