I tried this code but at the for
loop it seems to do nothing.
#include <stdio.h>
#include <stdlib.h>
void main()
{
char word[100];
char suf [100];
int i,j,k = 0;
char a [100];
printf("Enter the word: \n");
gets(word);
printf("\n");
for (i = strlen(word); i < 0; i--)
{
a[i] = word[i];
printf("%s",a);
}
}
Example Output:
>> Enter the word: Program
>> m
>> am
>> ram
>> gram
>> ogram
>> rogram