How to delate an Array Character form an Array in C Programming.
In this article we will learn about how to delete a character form array in c programming language.
#include<stdio.h>
void main()
{
int a[10]={0},i,j,k,l,n,m,d;
printf("Enter Element to Enter ");
scanf("%d",&n);
n--;
printf("Enter %d elements \n",n+1);
for(i=0; i<=n; i++)
{
scanf("%d",&a[i]);
}
printf("You Have Entered : \n");
for(j=0;j<=n; j++)
{
printf("%d\n",a[j]);
}
printf("Enter Element Number To Delete :");
scanf("%d",&d);
d--;
for(l=0; l<n+1; l++)
{
if(l>=d)
a[l]=a[l+1];
}
for(k=0;k<=n; k++)
{
if(a[k]!=0)
printf("%d\n",a[k]);
}
}
Read Also
- How to Integrate Paytm with WordPress (Contact Form 7) and PHP
- How to connect MySQL Remove server from Localhost or any server
- Payment Link Generator Instamojo | PHP | MySql |WebHook
- How to Integrate Cash Free Payment Gateway with PHP [Documentation]
- How to integrate PayU (PayU Money) with PHP [Documentation]
[…] Read Also :- C Structure with Array and Loop Program […]