How to Print an Array in C Programming Language

This program will read an array and print that array as output. In this program, we have used the for loop to print all elements of an array. When you execute this program, It will ask to enter the number of array elements and then take elements as input and store in an array variable.

Let assume if you enter the number of elements as 2, then you need to enter two elements as input. see the below program output.

c program to read an array

Copy the below c program and execute it with the help of c compiler.

Program Output:

Enter no of elements :2
Enter the values :50
90
arr[0] = 50
arr[1] = 90

Recommended Posts:


Prem Tiwari

An engineer by profession and a passionate blogger by heart. Founder of FreeWebMentor.com (A Programming blog for beginners), Tech Speaker at various forums. A part from this he is an open source enthusiast, WordPress Lover, Blogger, SEO, and Growth Strategic.

Article Tags: , , , , ,

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Solved Programs