Log

/** * Write a description of class log here. * * @author (your name) * @version (a version number or a date) */ import java.util.*; public class logcal { // instance variables - replace the example below with your own public logcal() { // initialise instance variables Scanner scanner = new Scanner(System.in); System.out.println("Put in log base"); int b = scanner.nextInt(); System.out.println("Put in log number"); int num = scanner.nextInt(); int temp = num; int log = 0; while (temp > 1){ temp /= b; log++; } System.out.println(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.