From ef273aeab119fc29a8401758487e9d7e50e36540 Mon Sep 17 00:00:00 2001 From: Himanshi008 <65394940+Himanshi008@users.noreply.github.com> Date: Sat, 17 Oct 2020 12:56:35 +0530 Subject: [PATCH] Occurrence of an element . This program will help us to find the number of occurrence of an element in an array. --- n_occurrence.cpp | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 n_occurrence.cpp diff --git a/n_occurrence.cpp b/n_occurrence.cpp new file mode 100644 index 0000000..0d99277 --- /dev/null +++ b/n_occurrence.cpp @@ -0,0 +1,25 @@ +#include +using namespace std; +int main() +{ + int n,i,m,count=0; + cout<<"Enter the size of an array : "; + cin>>m; + int arr[m]; + cout<<"Enter the elements of array : "; + for(i=0; i>arr[i]; + } + cout<<"Enter the element to be check : "; + cin>>n; + for(i=0; i