Syntax (Single Condition) :
int a;
string b = "true";
a = 10 / 5;
if (a == 2)
{
MessageBox.Show(b);
}
Result:
Display "True" on messagebox or dialog box.
Syntax (Multiple Conditions) :
int a;
string b = "true";
string c = "wow";
a = 5 / 5;
if (a == 2)
{
MessageBox.Show(b);
}
else if (a == 1)
{
MessageBox.Show(c);
}
Result:
Display "wow" on messagebox or dialob box.
No comments:
Post a Comment