User Input for Arrays in C Using For Loop | Read & Display Array Elements @LearningLad
User Input for Arrays in C Using For Loop | Read & Display Array Elements  @LearningLad
Uploaded September 2026 | Updated November 2026, 1 day ago
Learn how to take user input for an array using a for loop in C programming and how to display all the array elements using another loop.

In this tutorial, we create an integer array and use a for loop to go through each array element. Instead of manually accessing every index and assigning values individually, we use an index variable that starts from 0 and increases with every iteration.

You will learn how to use scanf() to read an integer from the user and store it directly in a specific array element. We use the address-of operator with numbers[index] to provide scanf() with the address of the required array element.

After taking input for all the elements, we use another for loop to access and display each array index and its corresponding value using printf().

We also discuss why the loop condition uses index less than array size and how an index variable declared inside a for loop has scope limited to that loop.

At the end, you can practice by modifying the program to display element numbers instead of indexes while taking input and display the array elements in reverse order.

Our Website
LearningLad.com

Social Media
Facebook facebook.com/LearningLad
Twitter twitter.com/LearningLadEdu
Instagram instagram.com/LearningLadOfficial
User Input for Arrays in C Using For Loop | Read & Display Array ElementsWhile Loop in C Programming | Infinite Loop Explained with ExamplesPassing Pointers to Functions in C | Modify Variables Using Memory AddressesDo While Loop in C Programming | Syntax, Examples & Menu-Driven ProgramHow to Read Character from the File using fgetc function | File Handling in C LanguageBanking System Project in C Programming - Part 2 | View, Deposit Funds ImplementationHow to Write Characters Using the fputc Function | File Handling in C LanguageLets Build a Banking System Project using C Programming LanguageLearning C Programming Language compared to EnglishC Programming: How to Get the Memory Address of a Variable | & Operator ExplainedPointer to const in C Explained | Read-Only Access & const int Pointersfputs() Function Explained with Examples | C Programming File Handling  Tutorial for Beginners
LearningLad |

User Input for Arrays in C Using For Loop | Read & Display Array Elements

SHARE TO X SHARE TO REDDIT SHARE TO FACEBOOK WALLPAPER