Skip to content

Instantly share code, notes, and snippets.

@faisal95bd
Last active October 27, 2022 14:08
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
3 - Reverse string
#include <stdio.h>
#include <string.h>
int main()
{
char str[100], strmain[100], strup[100];
printf("Enter the string to reverse:\n");
gets(str);
for (int i = 0; str[i] != '\0'; i++) {
strup[i] = toupper(str[i]);
}
strcpy(strmain, strup);
strrev(strup);
printf("Final result: %s%s \n", strmain, strup);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment