conditional statement
Jun 6, 2013 at 11:57pm
how do i turn this into if/else statement
|
cout << (((num % 2) == 0) ? "Even\n" : "Odd\n");
|
Jun 6, 2013 at 11:58pm
if ( num % 2 == 0 ) cout << "Even\n";
else cout << "Odd\n";
Last edited on Jun 6, 2013 at 11:59pm
Topic archived. No new replies allowed.