Advertisement
Guest User

Untitled

a guest
Apr 25th, 2019
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. #include <stdio.h>
  2. // IMPLEMENTAR DOS FUNCIONES, la primera debe cargar un vector de 4 componentes enteras
  3. // la segunda funcion debe determinar cuantas componentes mayores a 10 hay
  4. int main()
  5. {
  6. // DEFINIR EL VECTOR
  7.  
  8. int numeros[4];
  9. cargar_vector(carga[4]);
  10. int cantidad_mayores = mayores(numeros[4]);
  11. printf("%i",&cantidad_mayores);
  12. }
  13.  
  14. void cargar_vector(int carga[4]) {
  15. int inicio;
  16. for inicio =0; inicio<4;inicio++); {
  17.  
  18. printf("Ingresa el sueldo:");
  19. scanf("%i",&numeros[inicio])
  20. }
  21. }
  22.  
  23. int mayores(int numeros[4]) {
  24. int inicio = 0;
  25. int contador =0;
  26. for (inicio=0; inicio<4; inicio++)
  27. {
  28. if (numeros[inicio] > 10)
  29. {
  30. contador++;
  31. } else {
  32. // SI ENTRA ACA NO HACE NADA
  33. }
  34. }
  35. return contador;
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement