Assignment
University
California State UniversityCourse
COMP 182 | Data Structures and Program Design and LabPages
2
Academic year
2023
KauK
Views
7
import java . util . Scanner ; public class Lab2_1 { public static void main ( String [] args ) { Scanner stdin = new Scanner ( System . in ); System . out . print ( "Please type in a positive integer: " ); int integer = stdin . nextInt (); String binary = "" ; while ( integer > 0 ) { binary += integer % 2 ; integer /= 2 ; } System . out . println ( "Reverse Binary is " + binary ); } }
COMP 182: Lab Assignment 2.1 - Convert to Reverse Binary
Please or to post comments