WAP in java to take input from user for age, designation, name, salary. If age>=25 then print Fibonacci series from 0 to age. If salary>=10000 then calculate the factorial of age . code example
Example: java fibonacci series code
public class Fibonacci {
public static void main(String[] args) {
int n = 10, t1 = 0, t2 = 1;
System.out.print("First " + n + " terms: ");
for (int i = 1; i <= n; ++i)
{
System.out.print(t1 + " + ");
int sum = t1 + t2;
t1 = t2;
t2 = sum;
}
}
}