Program
#include <stdio.h> int main() { printf("**************************************************************"); printf("\n**************************************************************"); printf("\n** WAP to enter and display an array **"); printf("\n** Created by Sheetal Garg **"); printf("\n** Assistant Professor **"); printf("\n** Phone No:9467863365 **"); printf("\n**************************************************************"); printf("\n**************************************************************\n"); int n,i,a[5]; printf("Enter no. of elements in the array\n"); scanf("%d",&n); printf("enter array elements"); for(i=0;i<n;i++) scanf("%d",&a[i]); printf("\nThe array elements are\n"); for(i=0; i<n; i++) printf("%d\n",a[i]); return 0; }
Output
*************************************************************************** *************************************************************************** ** WAP to enter and display an array ** ** Created by Sheetal Garg ** ** Assistant Professor ** ** Phone No:9467863365 ** *************************************************************************** *************************************************************************** Enter no. of elements in the array 4 enter array elements 23 32 21 14 The array elements are 23 32 21 14