Problem 04:
Write a program that
check if second number is square of first number
Discripition:
Multiplying frist
number itself get the result
Solution:
import java.util.*;
public class Message {
public static void main(String[] args) {
Scanner input= new Scanner(System.in);
System.out.println("Enter the frist
number");
int num1=input.nextInt();
System.out.println("Enter the Second
number");
int num2=input.nextInt();
if(num1==num2*num2)
System.out.println("Second number
is square of first");
}}
Output:
No comments:
Post a Comment