HTML & JS
#include<stdio.h>
void main()
{
   int a[10]={23, 45, 67,1};
   int n=4;  //element count
   //deleting element- 45
   printf("The elements before deletion :");
   for(int i=0;i<=n-1;i++)
      printf("%d ",a[i]);
   int s=1;    //index value of deleting element(45)
   for(int s=1;s<=n-1;s++)
      a[s]=a[s+1];
   n--;
   printf("\nThe elements after deletion:");
   for(int i=0;i<=n-1;i++)
      printf("%d ",a[i]);
}

Generated URL:

Output:

The elements before deletion :23 45 67 1 
The elements after deletion:23 67 1 
Report Bug