feat(strings): ex5

This commit is contained in:
Guz
2026-03-30 16:26:00 -03:00
parent 38389b2a04
commit 8d784e46d6

20
strings/ex5.c Normal file
View File

@@ -0,0 +1,20 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(void) {
char word[100];
printf("Digite a palavra: ");
fgets(word, 100, stdin);
word[strcspn(word, "\n")] = '\0';
for (int i = strlen(word) - 1; i >= 0; i--) {
printf("%c", word[i]);
}
printf("\n");
return EXIT_SUCCESS;
}