How do I convert this if-else statement to a conditional statement?
1 2 3 4 5 6
/*
if (n != 1)
cout << "There are " << n << " items left.";
else
cout << "There is 1 item left.";
*/
Here is what I tried:
n != 1 ? "There are " n " items left." : "There is 1 item left.";
Just having trouble finding the correct format. In a previous try, I assigned the text to string, but I'm still having trouble trying to determine the correct format. My book only shows me examples when dealing with numbers.