Posts

Showing posts from September, 2022

A program to Search element in array , and if repeated so at which location it is present and how many time the number is repeated

Image
  CODE :-  //FIXED-FINAL UPDATE FULLY WORKING CODE #include <iostream> using namespace std ; int i ; // I've created available() and notavailable() function and call it in the function named searching (); void available ( int n , int key , int arr []){       for ( int i = 0 , j = 1 ; i < n , j < n + 1 ; i ++ , j ++ ){           if ( arr [ i ] == key ){               cout << "the element present at : " << j << " location" << endl ;          }      } } void notavailable ( int n , int key , int []){     int arr [ n ];     for ( int i = 0 ; i < n ; i ++ ){         if ( arr [ i ] != key ){               cout << "the element is not present " ;               break ;           } ...