Computer Science, asked by sampath113, 1 month ago

int no[] = { 2, 6, 55, 1, 34, 555, 0, 12, 331,70,8};
System.out.printl(no.length);
System.out.printl(no[2] + "," + no[5] );​

Answers

Answered by BrainlyProgrammer
2

 \orange{ \texttt{Corrected Snippet:-  }} \begin{cases}  \red {\tt int \: no[] = { 2, 6, 55, 1, 34, 555, 0, 12, 331,70,8}; }\\   \red{\tt System.out.println(no.length);} \\  \tt  \red{System.out.println(no[2] + "," + no[5] );} \end{cases}

Output:-

11

55,555

Always Remember!

  • no.length :- it will return the no. of elements in elements in 'no[] array'
  • Index numbers of an array always starts with 0.
  • If the length of an array is n then the last Index of an array will be n-1
Similar questions