4
I would like to know if you have how to use logical operators and/or ternary operator within the Cout, as well as is possible within the printf.
int main ()
{
int n = 5;
//Como fazer isso (Funciona)
printf ("O numero %se maior que 5\n", n > 5?"":"nao ");
//Utilizando cout (Nao funciona)
cout << n > 5?"O numero e maior que 5":"O numero nao e maior que 5" << endl;
return 0;
}
Thank you very much!
– Vitor Carlos