10 programs of arrays in java?
Answers
Answered by
3
hope it helps PLEASE MARK ME AS BRAINLIST
tysm
Attachments:
Answered by
1
10 Java Arrays based questions:
- Accept 10 numbers into an array and then calculate the sum of numbers present in odd positions and even positions respectively.
- Accept 10 numbers into an array and then calculate the sum of even numbers present in odd positions.
- Create an array of size 10. Automatically fill the array with the factorial of number between 1 to 10, and then display the content of array.
- Create three arrays A, B and C both of size 5. Accept numbers in two arrays A and B. Fill all the elements of array C with the sum of numbers present in appropriate element of array A and B.
- Create two arrays A and B of size 5 and C of size 10. Accept numbers in two arrays A and B. Fill the array C in such a way that the first five positions occupy the numbers present in array A and rest of five positions occupy the numbers present in array B.
- Create two arrays A and B of size 5 and C of size 10. Accept numbers in two arrays A and B. Fill the array C in such a way that the all odd positions occupy the numbers present in array A and all even positions occupy the numbers present in array B.
- Accept numbers in array A[10] & create another array B[5]. The array B first location fills with sum of first & second location of array A. The array B second location fills with sum of third & forth location of array A. Similarly fill all the position of array B & display it.
- Accept data into two integers array A & B of size 5 elements each. The program should create another array T that finds the intersection of the two arrays. For e.g. if A = {1,3,5,7,8} & B = {7,4,2,8,9} Then T = {7,8}
- Accept numbers into an integer array A of size 4, create another string array B of size 3. Accept any three mathematical symbols like (+, -, *, /) in array B. Then according to mathematical symbol calculate the answer. For e.g. if A = [8, 6, 4, 2] & B = [+, -, *], then answer will be (((8 + 6) - 4) * 2) = 20
- Create an array of size 10 then accept 9 numbers into it. Then accept another number and its position where you want to insert it. Insert the given number in given position then Display the array.
Similar questions