Programming Examples

C program to initialize an array with 5 elements and print all elements


Write a C program which initialize a array with 5 integer values and print the all elements of Array

Solution

#include<stdio.h>
#include<conio.h.
void main()
{
	int num[]={4,5,6,8,9};
	int a;
	clrscr();
	printf("Array Elements Aare: ");
	for(a=0;a<5;a++)
	{
		printf("%d\t",a);
	}
	getch();
}
Output

Array Elements Aare: 4 5 6 8 9

Online Exam Quiz for One day Exam Online Typing Test CCC Online Test 2026 Best Computer Training Institute in Prayagraj (Allahabad) Best Java Training Institute in Prayagraj (Allahabad) Best Python Training Institute in Prayagraj (Allahabad) O Level Online Test in Hindi Best Website and Software Company in Allahabad