C program to enter elements in array of your choice

Elements in array of your choice

This program illustrate the concept of elements in array of your choice. Array is a collection of similar types of element.It stores the elements in contiguous memory location.

  • In this program we have defined a maximum size of array is “100” i.e. user can input maximum 100 elements in the array.
  • Ueer can input the element using “scanf”.
#include<stdio.h>
#include<conio.h>
void main()
{
int x,i,a[100];
clrscr();
printf("Enter size of array:-\n");
scanf("%d",&x);
printf("Enter element in array:-\n");
for(i=0;i<x;i++)
  {
   scanf("%d",&a[i]);
  }
printf("Elements of array are:- \n");
for(i=0;i<x;i++)
{
 printf("%d\n",a[i]);
}
getch();
}

OUTPUT:-

Elements in array of your choice


Comment below if you are facing any problem.


Also read

Defining array in c lanaguage
C program to multiply two matrix
How to subtract two matrice in c program


Summary
C program to enter elements in array of your choice
Article Name
C program to enter elements in array of your choice
Description
This program illustrate the concept of elements in array of your choice Array is a collection of similar types of element.
Author
Publisher Name
Scanfcode
Publisher Logo

Leave a Reply

Your email address will not be published. Required fields are marked *