import java.util.Scanner;
 
public class GCD {
 

public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
 
        System.out.println("Enter the two numbers: ");
 
        int a = input.nextInt();
        int b = input.nextInt();
        System.out.println("The two numbers are: " + a + " and " + b);
        System.out.println("The GCD of two numbers is: " + gcd(a, b));
 
 
}
 
// Eucid algorithm 
public static int gcd(int a,int b)
{
  if(b==0)
   return a;
  else
   return gcd(b,a%b);
}
}

GCD.main(null)
Enter the two numbers: 
The two numbers are: 5 and 30
The GCD of two numbers is: 5
import java.util.Scanner;
 
public class LCM {
 

public static void main(String[] args) {
        (Scanner input = new Scanner(System.in);
 
        System.out.println("Enter the two numbers: ");
 )
        int a = input.nextInt();
        int b = input.nextInt();
        System.out.println("The two numbers are: " + a + " and " + b);
        System.out.println("The LCM of two numbers is: " + lcm(a, b));
 
 
}
public static int gcd(int a,int b)
{
  if(b==0)
   return a;
  else
   return gcd(b,a%b);
}
public static int lcm(int a,int b)
{
  return a*b/(gcd(a,b));
}
 
}
LCM.main(null)
Enter the two numbers: 
The two numbers are: 6 and 10
The LCM of two numbers is: 30
class GFG {
  
    // Function to print the fibonacci series
    static int fibonacci(int n)
    {
        // Base Case
        if (n <= 1)
            return n;
  
        // Recursive call
        return fibonacci(n - 1)
            + fibonacci(n - 2);
    }
  
    // Driver Code
    public static void main(String args[])
    {
        Scanner input = new Scanner(System.in);
        System.out.println("Enter a number: ");
 
        int N = input.nextInt();
        System.out.println("The number is: " + N);
        for (int i = 0; i < N; i++) {
  
            System.out.print(fibonacci(i) + " ");
        }
    }
}

GFG.main(null)
Enter a number: 
The number is: 9
0 1 1 2 3 5 8 13 21