#include <stdio.h>
#include <string.h>
void reverse(char *userArray);
#define MAX_LENGTH 50
int main() {
char test[] = "TAEJONG";
printf("original message: %s\n", test);
reverse(test);
printf("reversed message: %s\n", test);
return 0;
}
void reverse(char *userArray){
int length = strlen(userArray);
char temp;
for(int i = 0; i < length / 2; i++)
{
temp = userArray[length - 1 - i];
userArray[length - 1 - i] = userArray[i];
userArray[i] = temp;
}
}
To embed this project on your website, copy the following code and paste it into your website's HTML: