Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * A program that converts numbers to binary using recursion!
- *
- * @author Nitin Armstrong (the one and only)
- * @version 4.20
- */
- import java.io.*;
- import java.util.Scanner;
- public class BinaryPrintsvsRecursion
- {
- public static void main(String [] args) {
- Scanner scan = new Scanner(System.in);
- System.out.println("Hello, I am Elytra and welcome to recurion, a top class conversion tool.");
- System.out.println("Input the integer you wish to convert");
- int input = scan.nextInt();
- division(input);
- }
- public static int division(int input){
- int digit = input / 2;
- int counter = 0;
- counter++;
- if (digit > 0) {
- digit / 2;
- counter++
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement