0
Problem in switch statement how to assign a value to the variable
4 Answers
+ 2
There were a lot of minor errors.
âȘ There is no variable 'l' declared but you have used it.
âȘ It should be 'Math' and not 'Maths'.
âȘ You have misspelled println in case 'h'.
âȘ All the case should be replaced with strings.
âȘ Also Math.sqrt() returns a double so you must type cast it to (int).
Give input as-
10
20
Area
Here is your modified code.
https://code.sololearn.com/cCK6usSj1L16/?ref=app
+ 4
You forget to write colon in case it should be
case i:
And your variable l are undecleared and some other errors try to fix one by one
+ 1
Thankyou very much friends
0
But we could also change the data type of f to double