Conditional operator: ?

This example reads in two numbers and prints them out in order.

1
2
3
4
5
6
7
8
9
10
11
// Month
#include <iostream>
using namespace std;
int main() { 
  int month;
  cout<<"Enter the number of a month:";
  cin>>month;
  (month<1 || month>12)? cout<<"invalid\n": cout<<"valid\n";
  system("pause");
  return 0;
} // main
CODE

NEXT: Prints two numbers in order