5. Write the output of the following program codes

publicstaticvoidmain(String []args)
{
int a=20
String b=”Hello”;
System.out.println(“the no is”+a);
System.out.print(“Hello”);
System.out.println(“#######”);
System.out.print(“Bye:””);
}

Respuesta :

tonb

Answer:

see picture

Explanation:

There are several syntax errors in the program that need to be fixed:

  • No spaces in the declaration
  • No semicolon after variable a declaration
  • Incorrect double quotes everywhere
  • Extra double quote after "Bye:"

So the actual answer would be: the compiler will report syntax errors.

Ver imagen tonb

Answer:

the no is20

Hello#######

Bye:

Reason: Programming, hoped this is right!