{{#items}}

{{text}}

{{/items}} {{ctaText}}

{{#items}} {{/items}}

showing results for - "finding a given root if a number java"

Lylou

01 Jul 2016

```
1Scanner sc = new Scanner(System.in);
2 int a = sc.nextInt();//the number of which i want to find the root
3 System.out.println("enter the root:");
4 int rootNum = sc.nextInt();//the N-th number root
5 double powerOf = 1;
6 double sqrt = 0;
7 double b = 1;
8 while (a > b) {
9 sqrt = powerOf + 0.0000001;//flexible
10 powerOf = sqrt;
11 for(int i = 1; i < rootNum; i++) {
12 b = sqrt*powerOf;
13 sqrt = b;
14 }
15 }
```

Abree

15 Jun 2018

```
1 Scanner sc = new Scanner(System.in);
2 int a = sc.nextInt();//the number of which i want to find the root
3 System.out.println("enter the root:");
4 int rootNum = sc.nextInt();//the N-th number root
5 double powerOf = 1;
6 double sqrt = 0;
7 double b = 0;
8 while (a > b) {
9 sqrt = powerOf + 0.0000001;//flexible
10 powerOf = sqrt;
11 for(int i = 1; i < rootNum; i++) {
12 b = sqrt*powerOf;
13 sqrt = b;
14 }
15 }
```

your answer for

you will get a confirmation link on this - you will have to click that for successful submission of your answer. we require this to keep the website free of spam, bots and unhelpful content

please ensure to add code which is syntactically corrent and executes properly

ask question on maxinterview

you will get a confirmation link on this - you will have to click that for successful submission of your question. we require this to keep the website free of spam, bots and unhelpful content

please be clear, to the point and respectful