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

CCC Online Test 2021 CCC Practice Test Hindi Python Programming Tutorials 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 Bank SSC Railway TET UPTET Question Bank career counselling in allahabad Sarkari Naukari Notification Best Website and Software Company in Allahabad Sarkari Exam Quiz