SHARE
TWEET

Untitled

a guest May 19th, 2017 45 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <stdio.h>
  2. #include <conio.h>
  3. #include <string.h>
  4.  
  5. #define MAX 30
  6. int main() {
  7.     char string[MAX], string_contra[MAX];
  8.     printf ("Digite uma string: ");
  9.     scanf("%30[a-z A-Z -]s" ,&string);
  10.     printf("A string digitada foi: %s" ,string);
  11.     printf("\nTamanho da string: %d" ,strlen(string));
  12.    
  13.     //Percorrer o vetor
  14.     for (int i = strlen(string) ; i >= 0 ; i++)
  15.     {
  16.         int j=0;
  17.         string_contra[j++] = string[i];              
  18.     }
  19.     printf("A string ao contrario eh: %s" ,string_contra);
  20.     getch();
  21. }
RAW Paste Data
Top