Computer Science, asked by sanchari46, 1 year ago

What is the use of exponent in java codes??​


AryaPriya06: hi
pintu9435: hlo
AryaPriya06: i told u i m sorry i can,t
pintu9435: why
AryaPriya06: i m not allowed
sanchari46: plzz stop talking irrelevent
AryaPriya06: sorru
AryaPriya06: sorry
sanchari46: Ya its okay
AryaPriya06: thnx

Answers

Answered by AryaPriya06
1

they are just used to provide value to any variable.

If this helps then plzzzzz mark me brainliest :-)

Answered by meghanaattili
2

For example, if a user is prompted to enter two numbers and they enter 3 and 2, the correct answer would be 9.

import java.util.Scanner;

public class Exponentiation {

   public static double powerOf (double p) {

       double pCubed;

       pCubed = p*p;

       return (pCubed);

   }

   public static void main (String [] args) {

       Scanner in = new Scanner (System.in);

       double num = 2.0;

       double cube;    

       System.out.print ("Please put two numbers: ");

       num = in.nextInt();

        cube = powerOf(num);

       System.out.println (cube);

   }

}

Exponents are just used to provide value to any variable.

Similar questions