- 1

Error in the code

Where is the error in this code int age = 18; if ( !(age > 16) ) { Console.Write("Your age is less than 16"); } { else; Console .WriteLine("Welcome"); }

24th Nov 2020, 10:04 AM
Hamidofsky
3 odpowiedzi
+ 5
U don't need an opening braces '{' before else stmt..Just put it after the else..
24th Nov 2020, 10:05 AM
Alphin K Sajan
Alphin K Sajan - avatar
+ 5
24th Nov 2020, 10:07 AM
Alphin K Sajan
Alphin K Sajan - avatar
0
Thinks for your help
24th Nov 2020, 10:06 AM
Hamidofsky