English

Some of the code given below contains errors. Identify the error and correct it. Write the output of the correct/corrected code. int ad[] = {25, 5, 45, 4, 92, 2, 29, 9}; int ap = (ad[0] + ad[7])

Advertisements
Advertisements

Question

Some of the code given below contains errors. Identify the error and correct it. Write the output of the correct/corrected code.

int ad[] = {25, 5, 45, 4, 92, 2, 29, 9};
int ap = (ad[0] + ad[7]) /ad[5];
System.out.print(" Result =" + ap);
Very Short Answer
Advertisements

Solution

No Error: Output : Result = 17

shaalaa.com
  Is there an error in this question or solution?
Chapter 7: Arrays - One Dimension - Exercises [Page 174]

APPEARS IN

Rupa Pandit Computer Applications [English] Class 10 ICSE
Chapter 7 Arrays - One Dimension
Exercises | Q 3. (i) | Page 174
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×