0
8.9kviews
Write a program in C to delete all the occurrences of given number from an ARRAY. For example, supposes ARRAY A={2,5,3,9,2,2,3} and given no is 2 then after deletion ARRAY should have A ={5,3,9,3}
1 Answer
1
236views

Program:

#include<stdio.h>
#include<conio.h>
#include<string.h>
void del(char str[], char ch);
int main() {
char str[10];
char ch;
printf("\nEnter the string: ");
gets(str);
printf("\nEnter character which you want to delete: ");
scanf("%ch", &ch);
del(str, ch);
getch();
}
void del(char str[], char ch) {
int i, j = 0;
int size;
char ch1; …

Create a free account to keep reading this post.

and 2 others joined a min ago.

Please log in to add an answer.