Math, asked by KuBo9772, 1 year ago

If the ages of ram, shyam and ajay are input through the keyboard, write a program to determine the youngest of the three. use nested switch statement

Answers

Answered by Anushkasampa123
1
public class youngest { public static void main ( int r,int a, int s ) { if ( a

Anushkasampa123: Sorry....it will be:
public class choice
{
public static void main (int r,int s,int a)
{
switch (ch)
{
case 1:
if (r< a &&r <s)Sopln ("ran is the youngest ");
break;
case 2:
if (s Sopln ("shyam is the youngest ");
break;
case 3:
if (a Sopln("ajay is the youngest");
break;
default:
Sopln ("wrong choice");
}
}
}
Anushkasampa123: Sorry again...the program I have written is correct only there will be spaces after the if statement and the print statement and break.....Please ignore the comment I have written it was done by mistake....
Anushkasampa123: Please ignore my answer.....it is wrong
Similar questions