0

Hello everyone🙋🏻‍♂️, My code has error in switch case statment. Could anyone please help me to debug this.

I have write a program that generates the date of next day. I have defined the date of 5days in the variable and want to get the date of next day. I have used two different functions,one for printing the date and another for generating the date of next day. The program is showing an error massage which says that DUPLICATE CASE VALUE. But according to me their is not any duplication of value in switch case statement. Please anyone helps to debug this. Just see my code once please. https://code.sololearn.com/cbmpvNyIOumk/?ref=app

24th Apr 2021, 2:45 PM
Rohit Rathod
Rohit Rathod - avatar
3 Réponses
+ 4
It's because enum <months> has more than 1 constant defined with same value (number of days).
24th Apr 2021, 2:49 PM
Ipang
+ 2
No problem at all Rohit 👌
24th Apr 2021, 3:00 PM
Ipang
+ 1
Ipang oh I forgot that thing. Thank you so much for your answer. Let's I change the logic for my code. Once again thank you so much sir.
24th Apr 2021, 2:58 PM
Rohit Rathod
Rohit Rathod - avatar