Computer Science, asked by anjali7694, 1 year ago

using switch case statement write a program to find the volume of different solids bu taking suitable variables and data types​

Answers

Answered by Ankit02
9

OK,

import java.util.*;

class Ankit

{

public static void main(String args[])

{

Scanner obj = new Scanner (System.in);

System.out.println("Enter your choice :- 1 for cone 2 for cuboid");

int n= obj.nextInt();

switch(n)

{

case 1 :

..................................YOUR BODY..........................

break;

case 2:

..................................Your BODY .............................

break;

default:

System.out.println("INVALID OPTION");

}

}

}

Hope it helps;

IN YOUR BODY just write the basic function to get volume..

Answered by shirisha1981
0

Answer:import java.util.*;

class Ankit

{

public static void main(String args[])

{

Scanner obj = new Scanner (System.in);

System.out.println("Enter your choice :- 1 for cone 2 for cuboid");

int n= obj.nextInt();

switch(n)

{

case 1 :

..................................YOUR BODY..........................

break;

case 2:

..................................Your BODY .............................

break;

default:

System.out.println("INVALID OPTION");

}

}

}

Read more on Brainly.in - https://brainly.in/question/9491236#readmore

Similar questions