Practice Questions 8
Practice Questions 8
Provide
methods like push and pop. Use appropriate OOPs principles.
Hint: encapsulate an int array with some predefined size. During push
operation, if there is an overflow, then the array size should be
increased. Make sure that values are not lost in process of doing this.
Q2) Write a program to construct two matrices and display the sum of
those.
Q3) Find smallest and largest number in an array of 10 elements
without sorting the array.
Q4) Find a given no in an array
Q5) Accept ten names into an array and find the second largest name.
Q6) Write a program to taken inputs from user for two 3 x 3 Arrays and
display if both the arrays are equal or not. If not, print which elements
are not equal. Note: code should not use java.util.Arrays.equals()
method.
Q7) Write a program to take inputs from user for a 1xn array and sort it
in ascending and descending order.