Created
March 18, 2015 23:33
-
-
Save lettergram/0cbcb263fdec8c02c089 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
int main(){ | |
unsigned int size = 12; | |
char str[] = "Hello, Worms!"; | |
char temp; | |
int i = 0; | |
for( i = 0; i < size/2; i++ ){ | |
temp = str[i]; | |
str[i] = str[size - i]; | |
str[size - i] = temp; | |
} | |
printf("%s\n", str); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment