**Basic C-Programming****Design Control & Looping****Programs on Array**- » Insert & Display the elements
- » Calculate Sum & Average
- » Mean of n numbers
- » Find largest Number
- » Position of smallest element
- » Position of second smallest element
- » Find the Second Largest & Smallest Elements
- » Interchange largest & smallest element
- » Find array of integers containing duplicate elements
- » Insert an element at given position
- » Insert a number in an array stored in ascending order
- » Delete a number from given position
- » Delete a number from array stored in ascending order
- » Merge two unsorted array
- » Merge two sorted array
- » Insert & Display the element in 2D Array
- » Add all element of 2D Array
- » Print Lower Triangle Matrix
- » Find Transpose of a Matrix
- » Addition of Two Matrix
- » Multiplicaiton of Two Matrix
**Programs on Pointer****Pattern Programming****Programs on Function****Programs on String****Structure & Union****File Handiling****Additional programs**

# Program in C to delete a number from array that is already stored in ascending order

__Home__»

__C-Programming__»

__Programs on Array__» Program in C to delete a number from array that is already stored in ascending order

## Question : Write a Program in c to delete a number from array that is already stored in ascending order

\* C Program to to delete a number from array that is already stored in ascending order *\

# include < stdio.h >

int main( )

{

int a[20], i, n, ele ;

printf(" Enter the Numbers of elements: ") ;

scanf("%d ", & n) ;

printf("\n Enter the element of araay in Assending Order : \n") ;

for ( i = 1 ; i < = n ; i++ )

scanf("%d ", & a[i]) ;

printf("\n Array enter by user are :\n") ;

for ( i = 1 ; i < = n ; i++ )

printf("%d \t", a[i]) ;

printf("\n Enter a number you want to delete :") ;

scanf("%d ", & ele) ;

for ( i = 1 ; i < n ; i++ )

{

if ( a[i] < ele )

a[i] = a[i] ;

else

a[i] = a[i+1] ;

}

printf("\n Array after deleting a number are :\n") ;

for ( i = 1 ; i < n ; i++ )

pcanf("%d \t", a[i]) ;

return ( 0 ) ;

}