• + 0 comments

    here I Got this output...

    Scanner sc=new Scanner(System.in); int n=sc.nextInt(); sc.nextLine(); for (int i = 0; i

         char[] a= str1.toCharArray();
    
          //printing the even of strings
       // System.out.println(c);
        for(int c=0;c<a.length;c++){ 
            if(c%2==0) {
               System.out.print(""+a[c]);
               }}
            System.out.print(" ");
            for(int c=0;c<a.length;c++){
            if(c%2!=0){
            System.out.print(a[c]);}
            }
            System.out.println();
        }