#include <stdio.h>

int main() {
     char str[] = "Ganesh";
        char rev[] ="";
//      int i =0;
        printf("strlen(str) %d\n",strlen(str));
        for(int i=strlen(str)-1;i>=0;i--){
                printf("i %d str[%c] \n",i,str[i]);

        }

        for(int i=0;i<strlen(str);i++){
                printf("i %d str[%c] \n",i,str[i]);

        }

    return 0;
}

Embed on website

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