Operador condicional

Categorías: Lenguaje C++

   1 // operador condicional
   2 
   3 #include <iostream>
   4 using namespace std;
   5 
   6 int main ()
   7 {
   8   int a,b,c;
   9 
  10   a=2;
  11   b=7;
  12   c = (a>b) ? a : b;
  13 
  14   cout << c;
  15   cout <<"\n";
  16 
  17   return 0;
  18 }

Algoritmantes/Condicional (last edited 2008-04-20 14:40:04 by localhost)