NOTE: PLEASE ADD A COMMENT LINE OF MY CODE OR EXPLANATION LINE THANK YOU! public class StackTest{ static public void main(String... args){ MyStack stack = new MyStackArray(); System.out.print("ENTER...




NOTE: PLEASE ADD A COMMENT LINE OF MY CODE OR EXPLANATION LINE THANK YOU!






public class StackTest{


  static public void main(String... args){



   MyStack stack = new MyStackArray();



   System.out.print("ENTER AN INTEGER VALUE(n): ");


   int dec = new java.util.Scanner(System.in).nextInt();



   stack.push(dec %2);


   dec/=2;



   while(dec!=0)


   {



     stack.push(dec %2);


     dec/=2;


   }



   System.out.print("Decimal to Binary  :");


   while(!(stack.isEmpty())){


     System.out.print(stack.pop());


   }


  }


}



Jun 01, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here