#include<stdio.h> #include<string.h> main() { char str[50]; int i,j,len,temp; printf("enter the string\n"); gets(str); len=strlen(str); for(i=0,j=len-1;i<=len/2;i++,j--) { temp=str[i]; str[i]=str[j]; str[j]=temp; } printf("reversed string is : %s\n",str); }
No comments:
Post a Comment