Menu
Question Index
...

Write a program to create an array containing the numbers in the given range.

Input (From, To) Output (Integer Array)
10, 20 {10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20}
-6, 4 {-6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4}
2, 9 {2, 3, 4, 5, 6, 7, 8, 9}



class CreateNumbersInRangeArray
{
    public static void main(String s[])
    {
        int result[] = createNumbersInRangeArray(10, 20);
        
        for(int i = 0; i < result.length; i++)
        {
            System.out.print(result[i] + " ");
        }

    }


    public static int[] createNumbersInRangeArray(int start, int end)
    {
    }

}

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