Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <conio.h>
- #include <string.h>
- #define MAX 30
- int main() {
- char string[MAX], string_contra[MAX];
- printf ("Digite uma string: ");
- scanf("%30[a-z A-Z -]s" ,&string);
- printf("A string digitada foi: %s" ,string);
- printf("\nTamanho da string: %d" ,strlen(string));
- //Percorrer o vetor
- for (int i = strlen(string) ; i >= 0 ; i++)
- {
- int j=0;
- string_contra[j++] = string[i];
- }
- printf("A string ao contrario eh: %s" ,string_contra);
- getch();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement