CJCoding With Joseph
15free / daySign inCreate account
Back to Multiple Choice Quiz

Select topics to narrow your question pool, then enable Random to jump to a random question matching your filters.

Topics

Ternary Operator

C++ quiz · Question 12
easyConditionals

What is the output of this code?

Code

1#include <iostream>
2using namespace std;
3 
4int main() {
5 int x = 8;
6 string result = (x % 2 == 0) ? "even" : "odd";
7 cout << result << endl;
8 return 0;
9}