Computer Science, asked by webindassatyam4582, 11 months ago

Write a program that will find out the square of a given number

Answers

Answered by kirtisuryarao
0

Answer:

c program

will find out the square of a given number

plz mark this as the brainliest one

Answered by stylishtamilachee
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