0

trying to code a "and" statement in c# (answered)

https://code.sololearn.com/cYjrRmhVW2PZ i keep getting errors (i am still learning c#)

19th May 2022, 8:50 AM
charlotte
4 Answers
+ 2
* don't out semicolon after if statement and the total compound statement condition should enclose in brace * in c#, and operator is && * in Writeline, readline, the letter l must be capital. L Like : if( (numbera == 1) && (numberb == 1) ) Console.WriteLine("1"); * typo of using = , instead of == in last if. Do changes in all instances.. hope it helps you..
19th May 2022, 9:07 AM
Jayakrishna 🇮🇳
+ 2
Just in case you need an example from Jayakrishna🇮🇳 perfect advice if((numbera == 1) && (numberb == 1)) { Console.WriteLine("1"); } else if((numbera == 1) && (numberb == 0)) { Console.WriteLine("0"); }
19th May 2022, 9:14 AM
Ausgrindtube
Ausgrindtube - avatar
+ 1
use &&
19th May 2022, 8:59 AM
hossein B
hossein B - avatar
0
it works now thanks
26th May 2022, 7:54 AM
charlotte