Course Content
C Basics
C Basics
For Loop Practice
Example from the Previous Lesson
main
#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; }
Swipe to show code editor
Use the for
loop to display numbers from 10 down to 0 on the screen.
Thanks for your feedback!
For Loop Practice
Example from the Previous Lesson
main
#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; }
Swipe to show code editor
Use the for
loop to display numbers from 10 down to 0 on the screen.
Thanks for your feedback!