Advertisements
Advertisements
प्रश्न
Some of the code given below contains errors. Identify the error and correct it. Write the output of the correct/corrected code.
int WH[] = {11, 22, 33, 44, 55, 66, 77};
int n = WH.length -1;
for(int j = 0; j<=n/2; j++)
{
int tmp = WH[j];
WH[j] =WH[n - j];
WH[j] =WH[n - j];
}
System.out.print(" The array is: ");
for(int j = 0; j<WH.length; j++)
System.out.print(" " + WH[j]);अति संक्षिप्त उत्तर
Advertisements
उत्तर
No Error. Output : The array is: 77 66 55 44 33 22 11
shaalaa.com
क्या इस प्रश्न या उत्तर में कोई त्रुटि है?
अध्याय 7: Arrays - One Dimension - Exercises [पृष्ठ १७६]
