#include <stdio.h>
#include <string.h>
int main(){
char texto1[40], texto2[40], texto3[30];
printf("Escribe una frase: ");
gets(texto1);
strcpy(texto2,texto1);
printf("\n\nUna copia de tu frase es: %s ", texto2);
strncpy(texto3, texto1, 10);
printf("\n\nY sus 10 primeras letras son %s\n", texto3);
system("pause");
return 0;
}
No hay comentarios:
Publicar un comentario