Advertisement
Guest User

Untitled

a guest
Apr 25th, 2019
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int main()
  4. {
  5. //int enero = 31;
  6. //int febrero = 28;
  7. //int marzo = 31;
  8. //int abril = 30;
  9.  
  10. //ARRAYS / VECTORES / ARREGLOS
  11. int meses[4] = [31,28,31,30]
  12. int sueldos_empleados[10];
  13.  
  14. //vector indexado
  15. printf("El mes de enero tiene : %i",meses[0]);
  16.  
  17. float sueldos [3] = [324.342,444.23,662.32]
  18. printf("El ultimo sueldo del array es: %f", sueldos[2]);
  19.  
  20. // CONJUNTO DEL MISMO TIPO
  21.  
  22. // FOR
  23. // inicio, fin, incremento/decremento
  24. // SSS -> START, STOP, STEP
  25.  
  26.  
  27. // Por lo general cuando tengamos vectores vamos a usar una estructura repetitiva (en este caso FOR) para cargar o mostrar sus valores. Vectores indexados.
  28.  
  29. for (int f =0; f<10;f++)
  30. {
  31. printf("Ingrese el sueldo");
  32. scanf("%i",&sueldos_empleados[f])
  33. }
  34.  
  35. // sueldos empleados
  36.  
  37.  
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement