Code Below:


import java.util.*;
class ceasercipher
{
    public static void main()
    {
        Scanner s=new Scanner(System.in);
        System.out.println("Enter The Sentence");
        String st=s.nextLine();
        int l=st.length();
        if (l<=3 && l>100) 
        {
            System.out.println("INVALID INPUTS");
            System.exit(0);
        }
        System.out.println("The Cipher Text is:");
        for (int i=0;i< l;i++)
        {
            char ch=st.charAt(i);
            int ch1=ch;
            if (ch1>=65 && ch1<=90)
            {
                if (ch1>=78)
                ch1=ch1-13;
                else
                ch1=ch1+13;
            }
            if (ch1>=97 && ch1<=122)
            {
                if (ch1>=110)
                ch1=ch1-13;
                else
                ch1=ch1+13;
            }
            System.out.print((char)ch1);
        }
    }
}