Computer Science, asked by Cmsian, 11 months ago

03. Rewrite the following code after removing errors from it.

a) class Prg ()
{
void main
{
int x,y;
x= 5;
y= 6;
System.Out.Println (x+y);
}
}

Answers

Answered by manas3379
3

Explanation:

Correct code :

class Prg

{

void main(String[ ] args)

{

int x,y;

x = 5;

y = 6;

System.out.println(x+y);

}

}

Answered by BrainlyPromoter
2

Answer:

1 class Prg

2 {

3 ~~~~void main( String args [ ] )

4 ~~~~{

5 ~~~~~~~~int x, y ;

6 ~~~~~~~~x = 5 ;

7 ~~~~~~~~y = 6 ;

8 ~~~~~~~~System.out.println( x + y) ;

9 ~~~~}

10 }

^

|

|

Line numbers

The given program is written in Java programming language.

Hence, it must be corrected as per the syntax and rules of Java.

The errors are present in the following lines of the program,

1. Line number 1

2. Line number 3

3. Line number 8


BrainlyPromoter: Hope it is helpful for you. Message if you have any queries.
Similar questions