Advertisement
gmmmarcos

Practico 4 - Arreglos - ejercicio 1

Apr 24th, 2019
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include "pila.h"
  4.  
  5. int main()
  6. {
  7. CargarArreglo (hola[],8)
  8. return 0;
  9. }
  10.  
  11. int CargarArreglo ( int a[], int dimension)
  12. {
  13. char respuesta = 's';
  14. int i = 0;
  15.  
  16. while ( i < dimension && respuesta != 'n')
  17. {
  18. printf (\n"Ingrese un numero\n");
  19. scanf ("%i",&a[i]);
  20. printf ("\n Desea continuar?\n");
  21. scanf ("%c",&respuesta);
  22. i++
  23. }
  24. return i;
  25.  
  26. }
  27.  
  28.  
  29.  
  30.  
  31. /* 1. Hacer una función que reciba como parámetro un arreglo de números enteros y
  32. permita que el usuario ingrese valores al mismo por teclado.
  33. La función debe retornar la cantidad deelementos cargados en el arreglo.*/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement