answersLogoWhite

0

#include<stdio.h>

#include<conio.h>

void main()

{

int a[10],i,j,k,n;

printf("enter number of elements of array");

scanf("%d",n);

printf("Enter array elements");

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

{

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

}

printf("enter the element you want to delete");

scanf("%d",k);

for(j=0;j<n;j++)

{

if(a[j]==k)

{

a[j]=a[j+1];

n=n-1;

}

}

printf("The array after deletion of %d is:",k);

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

{

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

}

getch();

}

User Avatar

Wiki User

15y ago

What else can I help you with?

Related Questions

How do you write a program that accepts 50 integer values and sort them in basic programming?

Create an array with 50 elements and input the integers one a time, filling the array. Use an insertion sort on the array for each input except the first. Alternatively, input the values first and then use insertion sort.


Why you used link list in binary tree?

Linked list was introduced to reduce the space wastage done by array &amp; also to make easier the insertion and deletion of elements from a list. A binary tree contains nodes of elements where insertion,deletion &amp; searching is frequently done. So to make these operations easier linked list is used.


How can I efficiently implement a circular array in Python?

To efficiently implement a circular array in Python, you can use the collections.deque data structure. Deque allows for efficient insertion and deletion at both ends of the array, making it suitable for circular arrays. You can use the rotate() method to shift elements in the array, effectively creating a circular structure.


Which linked list can be randomly accessed by given locations?

In a word, none. Linked lists are sequential and must be traversed sequentially. For random access you need an array, but you lose the efficiency of a list when it comes to insertion/deletion.


What are the various operations that can be performed on a queue?

In queue insertion takes place on rear end and deletion takes place on front end. INSERTION(QUEUE,N,FRONT,REAR,ITEM) :QUEUE is the name of a array on which we are implementing the queue having size N. view comlete ans at http://mcabcanotes.in/algorithm-to-perform-insertion-and-deletion-in-a-queue/


How do you write a C Program to fill up an Integer Array?

Reference:cprogramming-bd.com/c_page1.aspx# array programming


Could you Write a program for 8086 microprocessor that displays on the monitor the average of 2 numbers from an array?

How to write a program for mouse in microprocessor?


How do you write a program to read set of numbers using by an array and display the ascending order of the given input numbers?

To write a C++ program to display the student details using class and array of object.


What are limitations of array?

1) Array is a static data structure. Hence it has to be declared with a fixed size. Changing the size of the array involves procedures like relocation, freeing memory space, etc2) They hold elements of the same data type. Hence they are not suitable for storing and working with different data types. 3) Insertion and deletion in any place other than the end of the array has a time complexity of O(n).


How do you write an assembly language program to find the sum of n numbers using array?

write an assembly language program to find sum of N numbers


How do you write a program in C to find and display the sum of each row and column of a 2 dimensional array of type float?

array type


Write a c program to find the maximum value of 25 element in an array?

int findMax(int *array) { int max = array[0]; for(int i = 1; i &lt; array.length(); i++) { if(array[i] &gt; max) max = array[i] } return max; }