Source code :
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(void)
{
char state[40];
char store[40];
int i=0,j=0,label;
printf ("Please input your statement for reverse : ");
gets (state);
strcpy(store,state);
label= strlen(state);
for (i=label;i>=0;i--)
{
if (i != label)
{
store[j]=state[i];
j++;
}
}
printf ("The statement was reverse like this : %s\n",store);
system ("pause");
return 0;
}
Thanks for watching.
Name : Phirum TanMajor : Tiknik Media Digital
No comments:
Post a Comment