Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Aprende Práctica de bucle For | Control de Declaraciones
Fundamentos de C

book
Práctica de bucle For

Ejemplo de la Lección Anterior

c

main

copy
#include <stdio.h>

int main()
{
int array[] = { 3, 6, 2, 134, 45,
2, 564, 8, 3, 531 };

for (int i = 0; i < 10; i++)
{
printf("Index of element: %d\tValue of element: %d\n", i, array[i]);
}

return 0;
}
1234567891011121314
#include <stdio.h> int main() { int array[] = { 3, 6, 2, 134, 45, 2, 564, 8, 3, 531 }; for (int i = 0; i < 10; i++) { printf("Index of element: %d\tValue of element: %d\n", i, array[i]); } return 0; }
Tarea

Swipe to start coding

Usa el bucle for para mostrar números del 10 al 0 en la pantalla.

Solución

#include <stdio.h>

int main()
{
for (int i = 10; i >= 0; i--)
{
printf("%d\n", i);
}

return 0;
}
¿Todo estuvo claro?

¿Cómo podemos mejorarlo?

¡Gracias por tus comentarios!

Sección 4. Capítulo 7
#include <stdio.h>

int main()
{
for (int i = 10;___;___)
{
printf("%d\n", i);
}

return 0;
}
toggle bottom row
some-alt