+ 1
Whats the error in this code ?[Solved]
3 Réponses
+ 2
Hey.
I guess the ternary operator does not work this way unfortunately. You just have to use the old-fashioned if-else statement.
What you can do is store the result in a string first:
string result = isPrime(12) ? "Yes" : "No";
cout << result;
+ 1
The_Fox Thanks buddy
+ 1
@MadKing
You are very welcome