हिंदी

Some of the code given below contains errors. Identify the error and correct it. Write the output of the correct/corrected code. int HC[ ] = {1, 2, 3, 4, 5, 6}; int n = HC.length -1; for(int j = 0; j

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 HC[ ] = {1, 2, 3, 4, 5, 6};
int n = HC.length -1;
for(int j = 0; j <=n/2; j++)
{
    HC[j] = HC[n-j];
System.out.println(" The array is: ");
for( intj = 0; j <HC.length; j++)
System.out.print("" + HC[j]);
अति संक्षिप्त उत्तर
Advertisements

उत्तर

No Error. Output: The array is : 6544 56

shaalaa.com
  क्या इस प्रश्न या उत्तर में कोई त्रुटि है?
अध्याय 7: Arrays - One Dimension - Exercises [पृष्ठ १७५]

APPEARS IN

रुपा पंडित Computer Applications [English] Class 10 ICSE
अध्याय 7 Arrays - One Dimension
Exercises | Q 3. (x) | पृष्ठ १७५
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×