public static String DecBin(int nbr)
String resultat="";
String decbin="";
//String temp;
int rest;
//temp="";
while(n/2>0)
{
rest=n%2;
//temp=temprest;
String rest1=Integer.toString(rest);
resultat=resultat+rest1;
}
for (int i=resultat.length();i<resultat.length()-1;i--)
decbin=String.valueOf(resultat.charAt(i));
return resultat;
mahabelg 0 Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.