Question 6
import java.util.Scanner;
class Question6
{
    public static void main()
    {
        Scanner scn = new Scanner(System.in);
        System.out.println("\n\t1. Sum of Series");
        System.out.println("\n\t2. Print series\n");
        System.out.print("\tEnter your Choice : ");
        int num = scn.nextInt();
        System.out.print("\n\t");
        switch(num)
        {
            case 1 : double s=0;int x=2;
            for(int t=1;t<=20;t++)
            {
                if(t%2==0)
                    s-=Math.pow(x,t);
                else
                    s+=Math.pow(x,t);
            }
            System.out.println("Sum of Series : "+s);
            break;
            case 2 :int p=0;
            for(int t=0;t<5;t++)
            {
                p+=(int)Math.pow(10,t);
                System.out.print(p+" ");
            }
            break;
            default : System.out.println("Invalid Choice ");
        }
    }
}