Jump to content

Oka Help Kaavali... Java Sodharulaku...


Recommended Posts

Posted

idhi kuda raaadha ani anukokunda.. 

 

please write a java function

 

which takes list of numbers as input and give array of their corresponding binary numbers as output.

 

job lo okadu nannu test chesthunadu boss.. exp gurinchi.. eee pressure naa valla kavadam ledhu .. evaranna ah function raaasi konchem help cheyandi boss.. 

Posted

edo konni basics vochu naaku....so idi choodu......decimal to array of binary numbers.

 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~`

 

package com.java2novice.algos;
 
public class DecimalToBinary {
 
    public void printBinaryFormat(int number){
        int binary[] = new int[25];
        int index = 0;
        while(number > 0){
            binary[index++] = number%2;
            number = number/2;
        }
        for(int i = index-1;i >= 0;i--){
            System.out.print(binary[i]);
        }
    }
    
    public static void main(String a[]){
        DecimalToBinary dtb = new DecimalToBinary();
        dtb.printBinaryFormat(25);
    }
}
 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Posted

simple approach  -- Let me know if you need own implementation instead of inbuilt method

 

package test;

 
public class TestClass {
 
public static void main(String[] args) {
 
int[] inputArray = {10,20,90,88,34,22};
String[] outputArray = new String[inputArray.length];
 
int counter =0;
 
for (int input : inputArray) {
outputArray[counter] = Integer.toBinaryString(input);
 
System.out.println(Integer.toBinaryString(input)); // inbuilt method in Integer Class 
}
 
 
}
 
}
Posted

I am leading a team of 20 - 22  Java developers uncle  :o

 

 

Zoo la - u know Java :o

 

Posted

I am leading a team of 20 - 22  Java developers uncle  :o

 

all developers are nose babu pans?

 

bolls to you laka taka..

Posted

no all are chembu babu fans 

 

I will parcel all boll to u if u want

all developers are nose babu pans?

 

bolls to you laka taka..

 

Posted

no all are chembu babu fans 

 

I will parcel all boll to u if u want

 

parcel them to ps02 plz...he can use them for cheeking purpose.

Posted

y ps02 anna in between .... u started naa ... it seems u interested 

parcel them to ps02 plz...he can use them for cheeking purpose.

 

×
×
  • Create New...