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

About: Prem Tiwari

Prem Tiwari is the founder of and also a professional developer who has vast experience in PHP and open source technologies. Apart from this, he is a blogger by hobby and also he has been a regular speaker of WordPress sessions in various IT Companies.

Tags: , , , , ,