How to Print an Array in C Programming Language

Prem Tiwari - - C Programming Tutorial

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
arr[0] = 50
arr[1] = 90

Prem Tiwari

Prem Tiwari is the founder of and also a professional developer and a blogger by hobby.

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.