For this Question: Given a string(1-indexed). Print all the characters of the string at odd positions.The first line of the input contains a string S. String contains only lowercase english letters.

Constraints:-
1 <= |S| <= 100
The output should contain the character's at odd positions seperated by space.Sample Input
abcde

Sample Output
a c e

Sample Input
abcd

Sample Output
a c

Explanation:
index => 1 2 3 4
chars => a b c d
a and c are at odd index., I have written this Solution Code: 
import java.util.*;
import java.lang.*;
import java.io.*;

class Main
{
	public static void main (String[] args) throws java.lang.Exception
	{
		Scanner sc = new Scanner(System.in);
		
		String s = sc.next();
for(int i = 0;i<s.length();i++){
if(i%2==0){
System.out.print(s.charAt(i)+" ");
}
   }
}
	    

}
, In this Programming Language: Java, Now tell me if this Code is compilable or not?