wap to enter a no and check that the sum and square are equal
Answers
Answered by
0
Answer:
import java.util.*;
class Sum
{
public static void main(String args[])
{
Scanner in = new Scanner(System.in);
double n,n2 = 0.0;
System.out.println("Enter a no.");
n = in.nextDouble();
n2 = Math.pow(n,2);
if(n == n2)
System.out.println("Sum and square are equal");
}
}
Similar questions