can any one please explain this code in csharp and what is mean by and in this state
Dim i As Integer
Dim Data1 As Integer
Dim Data2 As Integer
i = ReadAllDigital
cbi(1).Checked = (i And 1)
cbi(2).Checked = (i And 2) \ 2
cbi(3).Checked = (i And 4) \ 4
cbi(4).Checked = (i And 8) \ 8
cbi(5).Checked = (i And 16) \ 16
Vb code to csharp
3 Answers
Know the answer? Post it. Somebody with the same question will find it here.

Ryan AlfordRank #1,411 · 1.2K reputationPosted Dec 13, 2008, 8:11 AM EST
Bechir BejaouiRank #144 · 15.9K reputationPosted Dec 13, 2008, 12:57 AM EST
int i = 0;
int Data1 = 0;
int Data2 = 0;
i = ReadAllDigital;
cbi(1).Checked = (i & 1);
cbi(2).Checked = (i & 2) / 2;
cbi(3).Checked = (i & 4) / 4;
cbi(4).Checked = (i & 8) / 8;
cbi(5).Checked = (i & 16) / 16;
khaled alamoudi3 reputationPosted Dec 13, 2008, 1:33 AM EST