#include <stdio.h>
#include <string.h>
#if 0
int main(){
    char str[]="adarsh";
    int a=strlen(str);
    printf("%d\n",a);
    for(int i=0;str[i]!='\0';i++){
        if(str[i]=='a'){
            for(int j=i;str[j]!='\0';j++){
                str[j]=str[j+1];
            }
        }
    }
    printf("%s",str);
}

int main(){
    char str[]="adarsh";
    int a=strlen(str);
    printf("%d\n",a);
    char *b;
    for(int i=2;str[i]!='\0';i++){
        if(str[i]=='s'){
            for(int j=i;str[j]!='\0';j++){
                str[j]=str[j+1];
              }
        }
        printf("%c",str[i]);
        b=(char*)malloc(10*sizeof(char));
        memset(b,0,sizeof(str));
        strcpy(b,&str[i]);
    }
    printf("\n%s",b);
    
    //printf("%s",str);
}

#endif
//from and to index value
int main(){
    char str[]="adarsh";
    int a=strlen(str);
    printf("%d\n",a);
    for(int i=2;str[i]!='\0';i++){
        if(str[i]=='s'){
            for(int j=i;str[j]!='\0';j++){
                str[j]=str[j+1];
              }
        }
        printf("%c",str[i]);
    }
    //printf("%s",str);
}

Embed on website

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