Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * Código presentado por Elinv.
- * Dar vuelta un texto al reves por función.
- * CODE BLOCK 10.05 - Console Application
- */
- //Librerías
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
- #include <ctype.h>
- void alreves(char texto[])
- {
- int largo=strlen(texto);
- char t;
- int i, j;
- for(i=(--largo), j=0; i>largo/2; i--, j++)
- {
- // exchange elements
- t=texto[i];
- texto[i]=texto[j];
- texto[j]=t;
- }
- }
- // main program
- int main ()
- {
- char buffer[]= "hola espacio ya no estas";
- alreves(buffer);
- puts(buffer);
- }
Add Comment
Please, Sign In to add comment