delete a number in array in c

Solutions on MaxInterview for delete a number in array in c by the best coders in the world

showing results for - "delete a number in array in c"
Mirko
27 May 2017
1for (int i =  pos; i < size; i++)
2{
3    arr[i-1]= arr[i];
4        
5}
Carla
04 Mar 2018
1void remove_element(array_type *array, int index, int array_length)
2{
3   int i;
4   for(i = index; i < array_length - 1; i++) array[i] = array[i + 1];
5}
6
Noemi
07 Aug 2016
1#include<stdio.h>
2
3void main()
4{
5    int a[10], del_num, i, n, pos;
6
7
8    printf("Enter number of elements in array: ");
9    scanf("%d", &n);
10
11    for(i = 0; i < n; i++)
12    {
13        printf("Enter %d number: ",i+1);
14        scanf("%d", &a[i]);
15    }
16
17    printf("\n\nThe input array is: ");
18
19    for(i = 0; i < n; i++)
20    {
21         printf("%d ", a[i]);
22    }
23
24
25    printf("\n\nEnter the number to be deleted: ");
26    scanf("%d", &del_num);
27
28
29    for(i = 0; i < n; i++)
30    {
31        if(a[i] == del_num)
32        {
33            a[i]=0;
34
35        }
36    }
37
38    printf("\n\nResultant array is: ");
39
40    for(i = 0; i < n; i++)
41    {
42        printf("%d  ",a[i]);
43    }
44}
45
queries leading to this page
c program to delete all elemnet in arrayc program to delete the specified integer from an arrayremove element in array cc programming array remove item at indexhow to remove any element from an array in cdelete items of an array in cdelete from array chow to remove element in array cremove from array cdelete number from array in chow to delete element from array in cremove something from array ni cdeletion of an element in an array in chow to delete elements from rrray in cdelete an array in cdelete the element from array in chow to remove a integer from array in chow to delete array element while running code in cremoving an item from array chow to delete from an array cremove an element from a array chow to delete a index in an array carray deletio in chow to remove a element out a array in chow to delete values in an array in cdeleting array element in carrays remove cc program to delete an element in an array using functionremove array value in chow to remove an element of an array in cdelete element in array in cc delete certain number from arrayc delete element in arrayc remove index from arraydeleting an element from an array in cdelete element of array cdelete array in chow to delete one element from array in cdelete 5b 5d array cremove a value from array in c 27c how to delete array elementremoving elements from arrays in chow to remove an element an element from array in cc program for deletion of arry by valuehow to delete element in 1d array ion cdelete an element from an array in cc how to remove a value from an arraydeleting an element in array in cdelete array chow to remove array element in cc remove elemt rfom arrausing realloc to delete element from array chow to delete elements from array in chow to delete an element from araay cdelete element at any index array in cdelete a number in array in cfastest way to remove an item from an array in ccan i delete an array in cdelete value in array in cc remove from arrayhow to delete an element from an array in c languagedelete element from c arraydelete a number from an array in cdo delete free arrays in cdelete an array element in c gfgc delete arrayremove one element from c arrayhow to remove item from array in cc array removehow to remove items from array in chow to remove element from array in cdeletion of element in array in chow to remove element from array chow to delete an element in array in chow to remove value from array in chow to delete an element from an array in chow to remove an item from array in cremve the item from array in chow to delete array in chow to remove a value from array in chow to remove a number from array in chow to delement elemnt from the arrya in carray element deletion program in chow to remove elements from array in cdelete item from array cwrite a program in c to delete an element from an array how to delete array value in cdelete element from array c by functioninsert and delete element in array in cc remove value from arrayhow to remove an element from an array in cc code delete contents arrayfunction to delete an element from an array cc delete from arraydelete array element in chow to delare array in cdelete in array carray deletion in cc remove all elements from an arrayhow to delete an element in an array in cdelete element from array in cdelete element of array in cprogram to delete a number in array cremoving values form array cremove element form array in cprogram to delete an element in an array in chow to delete array index in cc delete elemnt from arrayhow to delete a element in array in chow to remove something from an array cdeleting array element by value c program how to we remove element from a array in cprogram for deletion of an element in array in cc how to remove element from arrayremove array index in cc remove elements from arrayhow to delete number from array in cdeleting an item from a array in chow to erase cahr array in chow to delete a array in chow to delete an array in chow to remove a particular value from array in cdelete number from array cdeletion in array by value in cc delete array elementdeletion in array in cremove an element from an array cremove array elements cdelete array c with the valuec how to erase element from arrayc array remove elementc program to delete an element in an arrayhow to delete an element in an array using cdrop an element from an array in cremove an element from array in chow to remove item from array ic cc array remove valuedelete all elements in array carray remove element in cdelete element from array c programdeletion in an element from array in cdeletion in array c programdelere element in array chow to remove some elements from an array in chow delete an element from array in cremove a element from array cc delete from array how to delete an array elemebt in chow to delete element from array cdelete element from array c languageremove elements in array carray delaration in cdelete an array element in cc delete item from arrayremove entry from array chow to delete element in array cremove item from array cremove an element from array cdelete element in array cdelete an element from an aray in cdeleting from array at position cdelete operation in array in cc program to delete the all specified integer from an arrayc remove array elementc delete an element from arraydelare array in cprogram to delete an element into an array in cremove element in array by index cdelete from an array in cdeleclare array of number cdelete element from array cc remove element from arraysimple delete value in array in cremove element from array in cc program to delete element from arrayc programming delete element from arraywrite a c program to delete an element from an array function deleting array element in cremove value from array chow to delete a value from an array in cremove element from array cerase element in c arrayhow to delete array element in cdelete element for array cc delete element from arraydelete a number from array in cremove an element from an array in cdeletion in an array in cremove element from an array cdelete a number in array in c