Suppose x is an array of type int[] with 50 elements. Write a code segment that will count and print the frequency of
number 42 in the array
Answers
Answered by
1
good afternoon my friend is looking to move in on a regular customer
l
Answered by
0
int c = 0;
for(int i = 0; i < 50; i++)
{
if( x[i] == 42)
{
c++;
}
}
System. out. println("Frequency of 42=" + c) ;
Similar questions