Home » » Switch in Java Program

Switch in Java Program

Switch in Java Program

Switch in Java Program

Switch in Java Program

class kumar
{
public Static void main(String [])
{
int a;
a=1;
swtich(a)
{
case 1:
int b,c,d;
b=10;
c=1;
d=b+c;
System.out.println("The value of d is:"+d);
break;
}
case 2:
{
int b,c,d;
b=100;
c=22;
d=b-c;
System.out.println("The value of d is:"+d);
break;
}
case 3:
{
int b,c,d;
b=22;
c=33;
d=b*c;
System.out.println("The value of d is:"+d);
break;
}
case 4:
{
int b,c,d;
b=22;
c=34;
d=b/c;
System.out.println("The value of d is:"+d);
break;
}
default:
{
System.out.println("You entered the wrong number");
break;
}
}
}
}


0 coment�rios:

Post a Comment

Link you don't want to vouch for Read more: https://html.com/seo/#ixzz5zVltiZ5g