Menu
Question Index
...

Create a word from the letters at the index passed from the multiple words(2d char array). The words length might be different.

Input(2D char array), index Output(char array)
{ { 'C', 'h', 'i', 'r', 'a', 'n', 'j', 'e', 'e', 'v', 'i'}, { 'V', 'e', 'n', 'k', 'a', 't', 'e', 's', 'h'}, { 'P', 'r', 'a', 'b', 'h', 'a', 's' }, { 'M', 'o', 'h', 'a', 'n', 'B', 'a', 'b', 'u' } } , 1 {'h', 'e', 'r', 'o'}
{ { 'S', 'o', 'f', 't', 'w', 'a', 'r', 'e' }, { 'E', 'n', 'g', 'i', 'n', 'e', 'e', 'r' } }, 0 {'S', 'E'}
{ {'M', 'a', 'n', 'g', 'o'}, {'S', 'a', 'p', 'o', 'd', 'i', 'l', 'l', 'a'}, {'B', 'a', 'n', 'a', 'n', 'a'} }, 3 {'g', 'o', 'a'}



class CreateWordFromIndexLetters
{
    public static void main(String s[])
    {
        char multipleWords[][] = {
                        { 'C', 'h', 'i', 'r', 'a', 'n', 'j', 'e', 'e', 'v', 'i'},
                        { 'V', 'e', 'n', 'k', 'a', 't', 'e', 's', 'h'},
                        { 'P', 'r', 'a', 'b', 'h', 'a', 's' },
                        { 'M', 'o', 'h', 'a', 'n', 'B', 'a', 'b', 'u' }
                     };
        char word[] = createWord(multipleWords, 1);
        System.out.print("The word is ");
        for(char ch : word)
        System.out.print(ch + "");

    }


    public static char[] createWord(char [][]words, int index)
    {
    }

}

Doubts

Problems

Topic: Learn Arrays And Loops

Read this topic
Take test on this topic

0
Wrong
Score more than 2 points

© meritcampus 2019

All Rights Reserved.

Open In App