Use two loops to divide the numbers upto the value of length of string.
Increment variable result when the remainder is 0.
If the variable result = 1, then print the corresponding character.
Program to print characters present at prime indexes in a given string : https://www.geeksforgeeks.org/program-print-characters-present-prime-index-given-string/