- 2

can any one solve the error

import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int emotion = scanner.nextInt(); switch(emotion) { case 1: System.out.print("You are happy!"); break; case 2: System.out.print("You are sad!"); break; case 3: System.out.print("You are angry!"); break; case 4: System.out.print("you are suprised!"); break; default: System.out.print("Unknown emotion."); } } }

17th Jun 2022, 1:14 AM
Iswarya Jeyakumar
Iswarya Jeyakumar - avatar
3 ответов
+ 2
Iswarya Jeyakumar Check spelling of 'suprised' It is 'surprised'
17th Jun 2022, 6:07 AM
A͢J
A͢J - avatar
0
no its not showing correct in test cases it seems u finished that part in java can u share with me ur code
17th Jun 2022, 1:25 AM
Iswarya Jeyakumar
Iswarya Jeyakumar - avatar
0
Thank you
18th Jun 2022, 6:09 AM
Iswarya Jeyakumar
Iswarya Jeyakumar - avatar