207k views
3 votes
Write a Java program to declare and store numbers from 1 to 10 in a single dimensional array and

display the output in the following format. 1 42769 38812 7 8 9 10

1 Answer

2 votes
class x {

public static void main (String args[])
{
/*declaration, instantiation and initialization */
int a[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};

}




}
User Richi
by
6.0k points