Programa que elebe un numero al cuadrado en netbeans !

Respuestas

Respuesta dada por: camilo2944
0
Que tengas buen dia
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */package brainly;import java.util.Scanner;
/** * * @author Administrador */public class Brainly {    /**     * @param args the command line arguments     */    public static void main(String[] args) {        Scanner scan = new Scanner(System.in);      int Exponente, base;        System.out.println("Ingrese El numero base: ");        base = scan.nextInt();        System.out.println("Ingrese El numero exponente");        Exponente = scan.nextInt();        int resultado = (int) Math.pow(base, Exponente);        System.out.println("El Numero es "+base + " elevado a la " + Exponente + " El resultado es igual a " + resultado);    }    }

camilo2944: public class Brainly {

public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int Exponente, base;
System.out.println("Ingrese El numero base: ");
base = scan.nextInt();
System.out.println("Ingrese El numero exponente");
Exponente = scan.nextInt();
int resultado = (int) Math.pow(base, Exponente);
System.out.println("El Numero es "+base + " elevado a la " + Exponente + " El resultado es igual a " + resultado);
}

}
Preguntas similares