Write a program that will find out the square of a given number
Answers
Answered by
0
Answer:
c program
will find out the square of a given number
plz mark this as the brainliest one
Answered by
2
Answer:
import java.util.Scanner;
public class power
{
void compute( )
{
Scanner sc=new Scanner(System.in) ;
int num1, num2;
System.out.print("Enter first integer number: ");
num1=sc.nextInt( );
System.out.print("Enter second integer number: ");
num2=sc.nextInt( );
System.out.println("Square of" + num1 + "is:" + Math.pow(num1,2)) ;
System.out.println("Square of" + num2 + "is:" + Math.pow(num2,2));
}
}
Explanation:
The Math.pow method returns first argument (called the base number) raised to power of second-argument (called the exponent).That is, return value of Math.pow( X,Y ) is X^y
Similar questions
English,
5 months ago
Social Sciences,
5 months ago
Science,
11 months ago
Computer Science,
11 months ago
CBSE BOARD X,
1 year ago