Advertisement
Guest User

Untitled

a guest
Nov 21st, 2017
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.40 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <string.h>
  4.  
  5. int main(){
  6.     char test[]="abcdefghijklmnopqrstuvwxyz";
  7.     int lon=strlen(test);
  8.     char *Nstr=malloc(sizeof(char)*lon);
  9.     char *ans;
  10.     ans=Nstr;
  11.     int i;
  12.     for(i=lon-1;i>=0;i--){
  13.         *Nstr=test[i];
  14.         Nstr++;
  15.     }
  16.     *Nstr='\0';
  17.    
  18.     printf("%s\n%s", test, Nstr);
  19.  
  20.     free(ans);
  21.     //free(Nstr);
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement