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 a program to convert a decimal number to binary form?



Write a program to convert a decimal number to binary form?..

Answer / hamada zahera

String s="";
while(n > 0 ) {

if(n % 2 == 0)
s+="0";
else
s+="1";

n=n/2;

}
s.reverse();

Is This Answer Correct ?    12 Yes 3 No

Post New Answer

More J2SE Code Interview Questions

write a c program which takes 20 numbers in an array as input from user and rearrange them in two different array defining even or odd

0 Answers  


How to create and run runnable jar file of a Java Project.

4 Answers   HCL, TCS, Tech Mahindra, US Consulate, Wipro,


Is it possible to define marker interface in java.If possible then how to define user defined marker interface?

1 Answers   Tech Mahindra,


Bubble Sort. java thereafter the user will be asked to inpout the size of the list,sort the list in ascending order and display the sorted list in a horizontal manner???

0 Answers  


Can we run Applet in Web browser with security policy files

0 Answers  


inner join,outerjoin,trigger,stored procedure explain with code snippets?

1 Answers   IBM,


write a program in java to solve a system of n-variabled simultaneous equations using the guassian elimination method. let the maximum possible value of n be 100. run the program using hypothetical values for a set of 10- variables simultaneous equations. print out the program, the input equation and the results generated by the program.

0 Answers   TCS,


write a java program to create a Frame with three scrolls, change the back ground color of the frame using functions with values of scrolls.

0 Answers  


write a program that inputs two real numbers then exchanges their values.

7 Answers   Infosys,


Why the program getting error if we don't use String args[] in main(), even in the case of not getting any arguments from command line?

1 Answers  


How to create Date method to set the date in Ms Access

0 Answers  


Write a java program to display multiplication table in a Frame.

1 Answers  


Categories