![]() ![]() Example:-Ħ) Put Even and Odd Elements in 2 Separate Arrays:- Write a Java program to put even and odd elements of an array in 2 separate arrays. And display both arrays. Take an array, count even-odd numbers, and display the count values. Then sum of array elements = 10 + 20 + 30 + 40 + 50 = 150Īnd the average of numbers = 150 / 5 = 30ĥ) Count Even and Odd numbers in an Array:- Write Array programs in Java to count the even and odd numbers in the given array. Use a method to perform this operation. Take input from the end-user, find the sum and calculate the average. Example:-Ĥ) Find the average of an Array:- Write a Java program to find the average of an array. To display an array you can use the while loop, for loop, for-each loop, or the toString() method given in class.ģ) Find the Sum of Array in Java:- Write Array programs in Java to find the sum of array elements in Java. Take an array, and display it using different approaches. Example:-Ģ) Different ways to Print Array:- Write an array program in Java to display a given array. Let us see Array programs in Java,ġ) Find Length of Array in Java:- Write a Java program to find the length or size of the different array. All the below programs are same as given in the above links, but here you will get the program description with some examples. Read the problem, try to solve it by yourself, and then check the solution.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |