Convert from decimal to octal

Convert from decimal to octal


Problem Description


Java program to convert from decimal to octal


Solution,


import java.util.Scanner;

import java.io.*;

public class TestClass {

public static void main(String[] args) { 

Scanner sc= new Scanner(System.in); 

       int a= sc.nextInt();

System.out.println(Integer.toOctalString(a));  

     }

Post a comment

0 Comments