LogThing

import java.util.*; public class logthing { public logthing() { Scanner scanner = new Scanner(System.in); System.out.println("Please enter log base"); int base = scanner.nextInt(); System.out.println("Please enter log number"); int number = scanner.nextInt(); int log = 0; while (number > 1){ number /= base; log++; } System.out.println("Log is " + log); } }

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.