Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main()
- {
- //int enero = 31;
- //int febrero = 28;
- //int marzo = 31;
- //int abril = 30;
- //ARRAYS / VECTORES / ARREGLOS
- int meses[4] = [31,28,31,30]
- int sueldos_empleados[10];
- //vector indexado
- printf("El mes de enero tiene : %i",meses[0]);
- float sueldos [3] = [324.342,444.23,662.32]
- printf("El ultimo sueldo del array es: %f", sueldos[2]);
- // CONJUNTO DEL MISMO TIPO
- // FOR
- // inicio, fin, incremento/decremento
- // SSS -> START, STOP, STEP
- // Por lo general cuando tengamos vectores vamos a usar una estructura repetitiva (en este caso FOR) para cargar o mostrar sus valores. Vectores indexados.
- for (int f =0; f<10;f++)
- {
- printf("Ingrese el sueldo");
- scanf("%i",&sueldos_empleados[f])
- }
- // sueldos empleados
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement