seergiomv

Ejercicio 2.4

Dec 11th, 2019
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.43 KB | None | 0 0
  1. #include <stdio.h>
  2. #define N 7
  3. void datos();
  4. void mostrar();
  5. typedef char cadenaCaracteres[50];
  6. cadenaCaracteres nombre[N];
  7. int main(){
  8.     char A[N];
  9.     datos(A);
  10.     mostrar(A);
  11. }
  12. void datos(char A[]){
  13.     printf("Introduce %d animales: ",N);
  14.     for (int i = 0; i < N; i++){
  15.         scanf("%s", &nombre[i]);
  16.     }
  17. }
  18. void mostrar(char A[]){
  19.     for (int i = 0; i < N; i++){
  20.         printf("%s",nombre[i]);
  21.     }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment