Ask Question
30 November, 23:23

You are given an array x of string elements along with an int variable n that contains the number of elements in the array. You are also given a string variable mode that has been declared. Assign to mode the mode value of the array. (Assume there are no "ties".)

+4
Answers (1)
  1. 1 December, 01:14
    0
    Answer and Explanation:

    Make an algorithm of that which include array x of string where Mode of the value of the array means that you have the values such that 1.2,4,2,6,7,8,2 so 2 is the value of set as it appears more than other number similarly when a array of x has been given. First of all initialize a variable then declare it. so for initialization create a variable. Let suppose i create a variable of add and initialize it with 0 and given a it data type integer then

    int add = 0; / / declaration

    int add[]=0; / / declaration and initialization in array

    class add {

    void main (String array[]) {

    int add[]=0; //declaration and instantiation

    int add[] = new int [3];

    add[0]=30; //initialization

    add[1]=80;

    add[2]=20;

    output the given array of string

    for (int i = 0; i
    cout <
    }

    Taking an other example let initialization and declare array of string and print the greater value. For this create a variable with integer data type /

    class Test{

    void main (String[] array) {

    //declaration of array

    int test[][] = new int [2];

    test[0]; new int [2];

    test[1]; new int [4];

    for initialization of array lets take variable a with data type integer

    int a=0;

    //taking loop for condition

    for (int i=0; i
    for (int j=0; j
    //if the loops working properly then take increment in the variable a

    test[i][j] = a++;

    this process repeat until loops got false

    for (int i=0; i
    for (int j=0; j
    cout<
    }

    System. out. println ();

    }

    }
Know the Answer?
Not Sure About the Answer?
Find an answer to your question ✅ “You are given an array x of string elements along with an int variable n that contains the number of elements in the array. You are also ...” in 📘 Computers and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers