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