हिंदी

What is the output of the following: int a = 0; int b = 10; a =-b; System.out.println("a:” + a + “b:" +b);

Advertisements

प्रश्न

What is the output of the following:

int a = 0;
int b = 10;
a =-b;
System.out.println("a:” + a + “b:" +b);
अति संक्षिप्त उत्तर
Advertisements

उत्तर

The given code produces a compilation error due to incorrect quotation marks in the System.out.println() statement.

Output: a:-10b:10

shaalaa.com
  क्या इस प्रश्न या उत्तर में कोई त्रुटि है?
अध्याय 6: Variables and Expressions - EXERCISE [पृष्ठ १३२]

APPEARS IN

धीरज मेहरोत्रा Computer Science [English] Class 12
अध्याय 6 Variables and Expressions
EXERCISE | Q 42. | पृष्ठ १३२
Advertisements
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×