Write an infinite loop using do while condition.
import java.util.*;
public class Solutions {
public static void main(String args[]) {
do {
} while(true);
}
}
Write an infinite loop using do while condition.
import java.util.*;
public class Solutions {
public static void main(String args[]) {
do {
} while(true);
}
}
Write a function that takes in age as input and returns if that person is eligible to vote or not. A person of age > 18 is eligible to vote.
Two numbers are entered by the user, x and n. Write a function to find the value of one number raised to the power of another i.e. x^n.
Take an array of numbers as input and check if it is an array sorted in ascending order.
Eg : { 1, 2, 4, 7 } is sorted in ascending order.
{3, 4, 6, 2} is not sorted in ascending order.
Write a program to print Fibonacci series of n terms where n is input by user :
0 1 1 2 3 5 8 13 21 .....
In the Fibonacci series, a number is the sum of the previous 2 numbers that came before it.