answersLogoWhite

0


Best Answer

The most simpliest way is to use a nested loop. However this runs in O(N*N) time. For small arrays, this should be sufficient.

User Avatar

Wiki User

14y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How do you find repeated integer number in the array in java program?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

How do you write a C Program to fill up an Integer Array?

Reference:cprogramming-bd.com/c_page1.aspx# array programming


How do you convert an integer to Boolean array list in java?

You cannot. An Integer is a numeric value whereas a boolean array list is a collection of a number of true or false values. So, you cannot convert either into the other


How do you write a program for counting and displaying occurrence of a number in an array?

Your first step is accepting input, which is done using the scanf() function:scanf("%d", &number);This means that you want scanf() to accept input, convert the input to a number, and store it in the memory at the address of number.Use a for() loop, counting from 0 to 9, and an array of integers to hold the numbers. Then simply scanf("%d", &intarray[counter]);The next step is a little tricky, but not very if you plan it out in advance.Each integer can contain 256, 65,536 or 4,294,967,296 different numbers. Creating an array to hold the count of each of those numbers is a waste of RAM.Instead, you'll want an "associative" array as follows:int numcount[MAXNUM][2];MAXNUM is 10, or the number of integers in the array you're checking. The second dimension, 2, consists of the number and its count.Obviously, you'll want a way to keep track of how many integers you've stored in numcount. An int called numcountnuminitialized to 0 would be the fastest way.Use a for() loop to iterate through the integers. If the integer does not exist in numcount, then set numcount[numcountnum][0] to the integer, set numcount[numcountnum][1] to 1, and increment numcountnum. Otherwise, if the integer exists, increase numcount[the integer index][1].Once the for() loop is finished, display the results. The only thing you have left to figure out is the function that searches the numcount array for an integer, and returns its index (or -1 if it's not found).


Program to print all the even numbers of an array in visual basic?

find even number in array


What is the sie of an array whos upper bound is 100?

To calculate the size of array the type of array should be given. Ex: if it is of integer type that means int arr[100] and integer is of 4 bytes, then the size of array will be 400 bytes.

Related questions

How do you write a C Program to fill up an Integer Array?

Reference:cprogramming-bd.com/c_page1.aspx# array programming


What does mode mean in a line plot?

The mode is defined as the term which is repeated for the highest number of times in an array or a sequence. If many terms are repeated for a similar number of times and highest, that array has more than one value for mode.


Program to count the number of numbers in an array using 8085 microprocessor?

A program which is used to count the number of numbers in an array using a 8085 microprocessor is known as a assembly language program.


What is the difference between a numericial array and an associative array?

A numericial array is an array with keys made up of only integers. An associative array is an array with keys made up of anything that is not an integer. In some languages, it is possible to mix integer keys and non-integer keys into a mixed array.


What is integer array in C programming?

An integer array consists of only integer numbers, for instance, if you have the array of size 5 with integer type date int_array[5] it means that your first element int_array[0] is an integer number like 1, or 15 and so on. The same is true for other elements too; int_array[1](int_array[2], int_array[3], int_array[4]) might be any integer element and so on.


How do you convert an integer to Boolean array list in java?

You cannot. An Integer is a numeric value whereas a boolean array list is a collection of a number of true or false values. So, you cannot convert either into the other


How do you write a program for counting and displaying occurrence of a number in an array?

Your first step is accepting input, which is done using the scanf() function:scanf("%d", &number);This means that you want scanf() to accept input, convert the input to a number, and store it in the memory at the address of number.Use a for() loop, counting from 0 to 9, and an array of integers to hold the numbers. Then simply scanf("%d", &intarray[counter]);The next step is a little tricky, but not very if you plan it out in advance.Each integer can contain 256, 65,536 or 4,294,967,296 different numbers. Creating an array to hold the count of each of those numbers is a waste of RAM.Instead, you'll want an "associative" array as follows:int numcount[MAXNUM][2];MAXNUM is 10, or the number of integers in the array you're checking. The second dimension, 2, consists of the number and its count.Obviously, you'll want a way to keep track of how many integers you've stored in numcount. An int called numcountnuminitialized to 0 would be the fastest way.Use a for() loop to iterate through the integers. If the integer does not exist in numcount, then set numcount[numcountnum][0] to the integer, set numcount[numcountnum][1] to 1, and increment numcountnum. Otherwise, if the integer exists, increase numcount[the integer index][1].Once the for() loop is finished, display the results. The only thing you have left to figure out is the function that searches the numcount array for an integer, and returns its index (or -1 if it's not found).


Program to print all the even numbers of an array in visual basic?

find even number in array


What program can read n number must contain four- digits only and if the second left digit odd put it in an array if not ignore it?

Input the number as a string. If the string has a length of 4 and contains only digits, convert the string to an integer. If the integer is less than 1000, input another number. Otherwise, copy the integer and divide by 100 to get rid of the two least-significant digits. Divide again by 2 and take the remainder. If the remainder is 1 then the second left digit of the 4-digit integer is odd and the 4-digit integer can be added to the array, otherwise do not add it. Repeat for all n numbers.


How do you make a program that counts how many times each digit occured in the integer?

To count the number of times a digit occurs in an integer, start by initializing an array of ten counts of digits, such as int digits[10];Then, in a loop while the number is non zero, increment the element in the digits array that corresponds to the units digit, and then divide the number by ten, such as digits[number%10]++ and number/=10;int digits[10];int i;int number = some number;for (i=0; i


What is the sie of an array whos upper bound is 100?

To calculate the size of array the type of array should be given. Ex: if it is of integer type that means int arr[100] and integer is of 4 bytes, then the size of array will be 400 bytes.


What is integer type array?

An array is a collection of similar data types. An integer array is nothing but a collection of integer data types. Ex: int a[100], int arr[100][100] There are several types. 1D array, 2D array, Multi-Dimensional array. But array is a contiguous allocation. And array size will always be positive. It can be given in the declaration stage or we can specify it dynamically by using malloc function. Ex: int *a; a=(int*)malloc(sizeof(int)*HOW_MANY_NUMBERS_YOU_WANT);