how do I code if radiobutton2 is checked then answer=9;

Hello I cant seem to find the right language construct.

I am trying to code.

if radiobutton2 is checked then
answer=9
else
answer=0

I know this should be an easy answer.

Thanks in advance.


Answer this question

how do I code if radiobutton2 is checked then answer=9;

  • bobby_dazzler

    int answer;
    if (radiobutton2.Checked)
    answer = 9;
    else
    answer = 0;

    I suggest that you work through some tutorials to gain a better understanding of c#. Feel free to ask for help when you don't understand something though, of course.

  • how do I code if radiobutton2 is checked then answer=9;