235k views
23 votes
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:””);
}

2 Answers

11 votes

Answer:

the no is20

Hello#######

Bye:

Reason: Programming, hoped this is right!

User Erfun
by
4.2k points
10 votes

Answer:

see picture

Step-by-step 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.

5. Write the output of the following program codes publicstaticvoidmain(String []args-example-1
User Inimene
by
4.9k points