Skip to content

Instantly share code, notes, and snippets.

@volosgoto
Created March 11, 2016 09:12
Show Gist options
  • Save volosgoto/8403a60fc210825ad10e to your computer and use it in GitHub Desktop.
Save volosgoto/8403a60fc210825ad10e to your computer and use it in GitHub Desktop.
Lesson_03_Task 2 (DifferentRadixSummator)
package Lesson_03;
import java.util.*;
public class DifferentRadixSummator {
public static void main(String[] args) {
Scanner myScan = new Scanner(System.in);
System.out.print("Enter X in Bin: ");
int x = myScan.nextInt(2);
System.out.print("Enter Y in Oct: ");
int y = myScan.nextInt(8);
System.out.print("Enter Z in Hex: ");
int z = myScan.nextInt(16);
int result = x + y + z;
System.out.println(result);
myScan.close();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment