Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- #include<stdlib.h>
- #include<string.h>
- void reversestring(char s1[], char s2[])
- {
- int l = strlen(s1);
- int i;
- for (i = 0; i < l; ++i)
- {
- s2[i] = s1[l-i-1];
- }
- s2[i] = '\0';
- }
- int main(int argc, char const *argv[])
- {
- char s1[] = "tran trung vi";
- char s2[100];
- //clrscr();
- //printf("Nhap vao chuoi ki tu\n");
- //scanf("%s",s1);
- reversestring(s1,s2);
- puts(s2);
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement