Advertisement
LuckyCipher

reversestring.c

Jan 28th, 2020
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.21 KB | None | 0 0
  1. #include <string.h>
  2. #include <stdio.h>
  3.  
  4. int main() {
  5. char a[] = "asdfgh";
  6. char b[20];
  7. int i = 0;
  8. for(i = strlen(a) - 1 ; i >= 0 ; i--) {
  9. b[(strlen(a) - 1) - i] = a[i];
  10. }
  11. printf("%s",b);
  12. return 0;
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement