Using the Conditional Operator to Make Comparisons - C++ Operator

C++ examples for Operator:Conditional Operator

Description

Using the Conditional Operator to Make Comparisons

Demo Code

#include <iostream> 
#include <string>
using namespace std; 

int main() /*from  w  w w.j a  va  2 s.  c o  m*/
{ 
  string name; 
  cout << "Type your name: "; 
  cin >> name; 
  cout << "Your name is " << name << endl; 
  return 0; 
}

Result


Related Tutorials