Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


write the programme that convert a interger to biniry number



write the programme that convert a interger to biniry number ..

Answer / bunny_1996

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

Post New Answer

More C++ General Interview Questions

What is the standard template library (stl)?

3 Answers  


Which software is best for coding?

0 Answers  


How to create a reference variable in C++

1 Answers  


What is pair in c++?

0 Answers  


Why c++ is created?

0 Answers  


Explain differences between alloc() and free()?

0 Answers  


If dog is a friend of boy and boy is a friend of house, is dog a friend of house?

0 Answers  


What issue do auto_ptr objects address?

2 Answers  


List the special characteristics of constructor.

0 Answers  


What is scope in c++ with example?

0 Answers  


Which algorithm do you like the most? Why?

2 Answers   Google,


Write some differences between an external iterator and an internal iterator? Describe the advantage of an external iterator.

0 Answers  


Categories