int crap = 5;int nocrap = Int32.TryParse(textBox1.Text, out nocrap) ? nocrap : 0;crap = crap >= nocrap ? crap : nocrap;MessageBox.Show(crap.ToString()); |
…aka if nocrap is greater than crap, then make crap=nocrap, else leave crap alone.
or without textbox input:
int crap = 5;int nocrap = 32 ? nocrap : 0; //modify nocrap value to be larger //or smaller than crap to see differencecrap = crap >= nocrap ? crap : nocrap;MessageBox.Show(crap.ToString()); |
