its for idea make ur selfView more random threads:
- CS610 Assignment 4 Idea Solution July 2010
- CS304 Object Oriented Programming Assignment 02 Fall 2014...
- CS615 Software Project Management Assignment 5 Deadline 7...
- CS610 Computer Network Assignment No.02 Fall 2013
- CS401 Computer Architecture and Assembly Language...
- I need Help....
- CS601 Data Communication Solution and Discussion Due Date:...
- MGT613 Production / Operations Management Assignment No. 01...
- MTH302 Bussiness Mathematics and Statistics Solution...
- CS506 Web Design and Development Assignment No. 02 Solution...
Code:#include<iostream> using namespace std; /*Function*/ int count_repeats(int array2[],int compare_element,int j){ int counter = 0,i; for(i=j;i<10;i++) { if(array2[i]==compare_element) counter++; j--; } return counter; } /*Main Method*/ int main(){ int array1[10],i,j,no_of_repeats; cout<<"Enter the length of the array you want to campre ... ";/*By assingnment set length to 10 time*/ cin>>j; for(i=0;i<j;i++){ cout<<"Enter the Elements : "; cin>>array1[i]; } for(i=0;i<10;i++){ no_of_repeats = count_repeats(array1,array1[i],i); if(no_of_repeats > 1){ cout<<"Element "<<array1[i]<<" repeats:"<<no_of_repeats<<" times \n"; } } return 0; system("pause"); }
Sponsored Links
There are currently 1 users browsing this thread. (0 members and 1 guests)