Queries for characters in a repeated string | C # Program to Queries for same characters in a repeated string ; Print whether index i and j have same element or not ; Finding relative position of index i , j . ; Checking is element are same at index i , j ; Driver Code
using System ; public class GFG { static void query ( string s , int i , int j ) { int n = s . Length ; i %= n ; j %= n ; if ( s [ i ] == s [ j ] ) Console . WriteLine ( " Yes " ) ; else Console . WriteLine ( " No " ) ; } static public void Main ( ) { string X = " geeksforgeeks " ; query ( X , 0 , 8 ) ; query ( X , 8 , 13 ) ; query ( X , 6 , 15 ) ; } }