+ 4

Error??

which error this code have?? int age=22; switch(age) { case 16: Console.Write("y"); break; default: Console.Write("o"); }

25th Apr 2017, 12:22 PM
Mayur Chaudhari
Mayur Chaudhari - avatar
10 Respuestas
+ 11
Wow tashi was right:D I thought everyone knows about imgur. www.Imgur.com is a website where you can upload pictures without the need of an account.
25th Apr 2017, 12:33 PM
Tim G
Tim G - avatar
+ 36
wow that was fast @tim
25th Apr 2017, 12:26 PM
Ruthresh kumar R
Ruthresh kumar R - avatar
+ 33
As far as I know, switch statement of C# (unlike C, Java or C++) requires break after each case. Put a break after default case, it'll work.
25th Apr 2017, 1:03 PM
Shamima Yasmin
Shamima Yasmin - avatar
+ 12
@Shamima is right!
25th Apr 2017, 1:17 PM
Tashi N
Tashi N - avatar
+ 10
Console.Write("y") isn't followed by a semicolon
25th Apr 2017, 12:24 PM
Tim G
Tim G - avatar
+ 10
make a screenshot and upload it on imgur
25th Apr 2017, 12:29 PM
Tim G
Tim G - avatar
+ 3
now this is question in challenge and challenge shows error is correct answer...
25th Apr 2017, 12:28 PM
Mayur Chaudhari
Mayur Chaudhari - avatar
+ 3
imgur????
25th Apr 2017, 12:32 PM
Mayur Chaudhari
Mayur Chaudhari - avatar
+ 2
sry guise this is my typing mistake
25th Apr 2017, 12:27 PM
Mayur Chaudhari
Mayur Chaudhari - avatar
+ 1
yes thanks friends
26th Apr 2017, 2:55 AM
Mayur Chaudhari
Mayur Chaudhari - avatar