Skip to content

Commit

Permalink
Solved Reverse String(pclubuiet#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
Z0Marlin committed Oct 4, 2017
1 parent 5b2ada2 commit 03de651
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions Reverse_String/Z0Marlin.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#include<stdio.h>
#include<string.h>
int main(){
char a[50],t;
int i,n;
printf("Input String : ");
n=(scanf("%[^\n]%*c",a),strlen(a));
for(i=0;i<n/2;i++){
t=a[i];
a[i]=a[n-1-i];
a[n-1-i]=t;
}
printf("%s\n",a);
}

0 comments on commit 03de651

Please sign in to comment.