0

will find number which is used frequently(often) in x array

int i;
int x[i],frequency[i];

for(int i=0;i<3;i++)
{
cin>>x[i];
frequency[i]=0;
}

frequency[i]=0;

for(int i=0;i<3;i++)
{
frequency[i]++;
cout<<x[i];
} 
frequency[i]++;
cout<<x[i];
cout<<frequency[i];

what should I do extra

Edited by lashatt2: n/a

2
Contributors
3
Replies
4
Views
6 Years
Discussion Span
Last Post by VernonDozier
0

Scoping problems. Too many variables named i. Make sure i is what you think it is.

Line 2 - wrong. The numbers in the brackets is the size. It's not a variable, particularly not an uninitialized variable. I assume it should be 3 instead of i?

Line 10. Scoping problems. i is used uninitialiazed.

Same with lines 17 through 19.

What precisely are you trying to do?

0

there are array of numbers for example:
I typed: 3
I typed: 3
I typed: 5

and

frequently number is: 3

I want to write the code which will do this

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.