You are viewing a single comment's thread. Return to all 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(); }
Seems like cookies are disabled on this browser, please enable them to open this website
I agree to HackerRank's Terms of Service and Privacy Policy.
Day 6: Let's Review
You are viewing a single comment's thread. Return to all comments →
here I Got this output...
Scanner sc=new Scanner(System.in); int n=sc.nextInt(); sc.nextLine(); for (int i = 0; i