Data Structures Using C Practice Questions - Arrays

"You cannot be great at the start, but you have to start to be great. So, making a beginning is important. In this list of questions, get your feet wet,before beginning a more arduous Data Structure journey"

— All the best

      Easy

    • Write a program to find out the maximum and the second maximum number from an array of integers.
    • Write a program that accepts a number as input in English language format such as One Twenty Three (for 123) and prints the decimal form of it.
    • The Mode of an array of numbers is the number in the array that is repeated most frequently. If more than one number is repeated with equal maximal frequencies, there is no mode. Write a program that accepts an array of numbers and returns the mode or an indication that the mode does not exist.
    • Write a program to delete duplicate elements from an array of 20 integers.
    • A square matrix is called symmetric if for all values of i and j, a[i][j] = a[j][i]. Write a program which verifies whether a given 5×5 matrix is symmetric, or not.
    • Build an array called chess to represent a chessboard and write a function that would be capable of displaying position of each coin on the chessboard.
    • There are two arrays A and B. A contains 25 elements, whereas B contains 30 elements. Write a function to create an array C that contains only those elements that are common to A and B.
    • A magic square of 5 rows × 5 columns contains different elements. Write a function to verify whether the sum of each individual column elements, sum of each individual row elements and sum of diagonal elements is equal or not.
    • Usually a polynomial is stored in an array with exponents of each term in decreasing order. Write a procedure to reverse this order, so that now the terms are arranged in increasing order.
    • Find the location of the element a[1][2][2][1] from a 4-D integer array a[4][3][4][3] if the base address of the array is 1002.
    • Design a data structure for a banking system where the maximum number of clients is 150. Information to be stored about clients—name, address, account no., balance, status as Low/Medium/High depending on balance.
    • Design a data structure for Income Tax department to hold information for maximum 200 persons. Information to be stored about persons—Income Tax no., tax amount, name, address, whether tax paid or not for previous year, group as High/Low depending on amount of tax to be paid and category which would vary from 1 to 10.

Find it difficult?

Don’t lose heart, don’t be under confident, just be consistent in your preparation and be sure of everything you’ve studied. You can request a class so that we can help you understant this topic.

Feel Confident?

Your first step in learning any new topic is to be aware of your strengths and weaknesses. Once you know this, your self-preparation can be meaningful and result-oriented. Attempt an quiz to get tested.