#include <stdio.h>

int main() {
     char *ptr = "Ganenha";
        //fInd character 'a' in a given string
        int i =0;
        while(ptr[i]!='\0'){
                printf("ptr[%d] %d\n",i,ptr[i]);

                for(int j=i+1;j<strlen(ptr);j++)
                {
                        if(ptr[i] == ptr[j])
                                printf("Found the duplicate string %c in the position %d \n",ptr[i],j);
                }
                i++;
        }

}

Embed on website

To embed this program on your website, copy the following code and paste it into your website's HTML: