-->

Array collection

Here are collection of programs using Array. Programs are written using one and two-dimensional. 

one dimensional programs:

q1)Write a program to enter any four elements and display that.
                                                                                                                                              solution

q2) Write a program to enter some elements and display that in opposite order.
                                                                                                                                              solution

q3).Write a program to get sum of numbers out of 'n' numbers entered by you.
                                                                                                                                              solution


q4).Write a program to display all numbers which are stored in even positioned cell of array.Let there are 'n' numbers.
                                                                                                                                              solution

q5)Write a program to display all numbers which are stored in odd positioned cell of array.Let there are 'n' numbers.
                                                                                                                                              solution

q6)Write a program to delete an element stored in an array. Let there are 'n' numbers..
                                                                                                                                              solution

q7)Write a program to swap any two values stored in array.Let there are 'n' numbers.
                                                                                                                                              solution

q8)Write a program to get maximum and minimum value among 'n' values stored in array.
                                                                                                                                              solution

q9)Write a program to store any 'n' elements and display those which are >15.
                                                                                                                                             solution
q10)Write a program to get sum of all elements of two one dimensional arrays.
                                                                                                                                              solution
q11)Write a program to get difference of all elements of two one-dimensional elements.                                                                                                                                                                                   solution
q12)Write a program to count total positive elements among 'n' elements.
                                                                                                                                              solution
q13)Write a program to sort (ascending order) elements stored in array.
                                                                                                                                              solution
q14)Write a program to sort (descending order) elements stored in array.
                                                                                                                                               solution

q15) WAP to enter salary of 'n' number of employees. Now count number of employees getting salary in range:
            a) less than 5000
           b) >=5000 and < 10000
           c)  >10000     
                                                                                                                                     solution
q16)WAP to search an element stored in an array.
                                                                                                                                                                                                                                                                         solution
q17) Write a program to show initialization of element in an array.
                                                                                                                                      solution
q18) Write a program to know repetition of elements stored in array.
                                                                                                                                      solution
multidimensional array programs:-
q19) WAP to input values for matrix of order 2x2 and display that.
                                                                                                                                  solution
q20)WAP to initialize elements of an array of size 2x2. Then display that.
                                                                                                                                  solution
q21) WAP to get sum of elements of an array of order 'mxn'.
                                                                                                                                  solution
q22) WAP to get sub-matrix of a matrix of order 'mxn'.
                                                                                                                                   solution
q23)WAP to get sum of elements of first row of a matrix of order 'mxn'.
                                                                                                                                   solution
q24)WAP to transpose  a matrix of order mxn.
                                                                                                                                   solution
q25)WAP to get sum of diagonal elements of a matrix of order mxn.

                                                                                                                                  solution

q26)WAP to print upper triangular matrix  of order mxn.
                                                                                                                                 solution
q27) WAP to print lower triangular matrix  of order mxn.
                                                                                                                                  solution

No comments:

Post a Comment