c program to delete any number in array
c program to delete any number in array
if you are using turbo c compiler please use #include<conio.h> header file. and if you are using devc++ or any other compiler than simply go through the given program below.
#include<stdio.h>
#include<string.h>
int main(){
int a[20],i,n,p;
printf("enter size of array\n");
scanf("%d",&n);
printf("enter the element of array\n");
for(i=0;i<n;i++){
scanf("%d",&a[i]);
}
printf("enter the position at which you want to delete the array\n");
scanf("%d",&p);
p=p-1;
printf("your final array is\n");
for(i=0;i<n;i++){
if(i==p){
continue;
}
printf("%d\n",a[i]);
}
}
Great code...
ReplyDelete