Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <string.h>
- char *reverse(char *string);
- int main(void){
- char phrase[]="yuppers";
- printf("%s", reverse(phrase));
- printf("\n");
- return 0;
- }
- char *reverse(char *string){
- int j=(int)strlen(string)-1;
- char temp;
- int i=0;
- while(i<j){
- temp=string[i];
- string[i]=string[j];
- string[j]=temp;
- i++;
- j--;
- }
- return string;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement