Progress on module: 6)

This commit is contained in:
Sangelo 2023-03-07 19:58:03 +01:00
parent 9d3f15ca88
commit 578cdc0153
2 changed files with 15 additions and 0 deletions

View File

@ -0,0 +1,15 @@
package net.stelian.m319.projectThree;
import java.lang.Math;
import java.util.Scanner;
public class Potenzen {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
// a^b=c
System.out.println("Enter a base: ");
double a = input.nextDouble();
System.out.println("Enter an exponent: ");
double b = input.nextDouble();
double c = Math.pow(a,b); // a) c wird als double ausgegeben
System.out.println("Result: "+c); // b) Zahl zu gross, Result: Infinity
}
}