Question: Find The Error Or The Errors in the Following programs segments and explain how to correct them. The errors may be in the syntax or

Find The Error Or The Errors in the Following programs segments and explain how to correct them. The errors may be in the syntax or in the logic of the code

1. If(x

System.out.println("y is between x and z");

2. if (gender =1)

System.out.println("Women");

else;

System.out.println("Man");

3. Switch(n)

{

case 1:

System.out.println("The number is 1");

case 2:

System.out.println("The number is 2");

break;

default;

System.out.println("The Number is not 1 or 2");

break;

4. int x=1;

while (X<=10);

x++

}

5. int n=0;

int sum;

while (n<=10)

sum += n;

n++

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!