Computer Science, asked by Anonymous, 1 year ago

write a java program to convert octal to binary????


Shivaya1: Sorry kl jo hua uske liye........Aur agar tum ye samhajti ho ki maine vo sab kiya tha...to mai tumhari soch badal nahi skata..........
Maine vi nahi kiya tha......Manna hai mannajao
Shivaya1: Aur kl jo khena tha yahi khedeta hu..............
Mai sirf tumse SORRY bolke DOSTI karna chata tha..............Pr tumne to phele hi mana krdiya tha.........isliye nahi bolna chata tha waha.......aur vo sala moderator bhi tha waha isliye nahi bola tha
Shivaya1: I am SORRY what i DID.......And Ek baar mujhe APNI baat BOLNE ka ek MUKA TO DO.......................sirf ek muka chiye mujhe apni baat bolne keliye....acha nahi lage to block krke chali jana.........

Nahi ata to bata deta hu unblock kaise karte hai.....
Mere ACCOUNT pe jao.......waha likha hoga WRITE MESSAGE.........waha CLICK KARO..........jo inbox khul jayega........frr wha alikha hoga unblock to krdena...................
Shivaya1: Maine bata diya ab TUMHARI MARZI...........Agar MUKA dena chati ho to dedo............Iss BAAR NIRASH nahi HONE DUNGA............Pakka
Shivaya1: Regard.....Rishi

Answers

Answered by Arinkishore
0
class Octal_Binary
{
Scanner scan;
int num;
void getVal()
{
System.out.println("Octal to Binary");
scan = new Scanner(System.in);

System.out.println("\nEnter the number :");
num = Integer.parseInt(scan.nextLine(), 8);
}

void convert()
{
String binary = Integer.toBinaryString(num);
System.out.println("Binary Value is : " + binary);
}
}
class MainClass
{
public static void main(String args[])
{
Octal_Binary obj = new Octal_Binary();
obj.getVal();
obj.convert();
}
}
Answered by Anonymous
0

import java.util.*;

public class octal

{

public static void main(String args[])

{

int oct, rem, quot, i=1, j;

int binnum[] = new int[100];

Scanner scan = new Scanner(System.in);

System.out.print("Enter Octal Number : ");

oct = scan.nextInt();

quot = oct;

while(quot != 0)

{

bin[i++] = quot%2;

quot = quot/2;

}

System.out.print("Equivalent Binary Value of " +octnum+ " is+n);

for(j=i-1; j>0; j--)

{

System.out.print(bin[j]);

}

}


EunKung: hiii
Anonymous: hlo
Shivaya1: Hlo
Anonymous: hii
Similar questions