-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathIterationAssignment.java
More file actions
26 lines (21 loc) · 615 Bytes
/
Copy pathIterationAssignment.java
File metadata and controls
26 lines (21 loc) · 615 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
package java_core;
import java.util.Scanner;
public class IterationAssignment {
public static void main(String args[]){
Scanner sc = new Scanner(System.in);
System.out.println("Kinldy enter the value of X");
int x = sc.nextInt();
int temp = x;
System.out.println("Kinldy enter the value of Y");
int y = sc.nextInt();
int root =1;
while (x>0){
root = root *(x%10);
x/=10;
}
System.out.println(temp*root);
if(temp*root==y){
System.out.println(temp+" is root of "+y);
}else{System.out.println(temp+" is NOT root of "+y);}
}
}