[Did you know Cards](https://didyouknow.cards/) › [Computing](https://didyouknow.cards/topics/computing) › Conditional operator

# Conditional operator

Conditional operator: ternary operator "x ? y : z" in many programming languages, whose value is y if x evaluates to true and z otherwise. No. 230,482 of 4,515,532 cards by fame.

## Conditional operator: quick facts

- **Description**: Ternary operator "x ? y : z" in many programming languages, whose value is y if x evaluates to true and z otherwise
- **Rarity in the game**: Epic card
- **Fame**: [No. 230,482 of 4,515,532 cards by fame](https://didyouknow.cards/about#how)
- **In its topic**: No. 4,417 of 15,859 “[Computing](https://didyouknow.cards/topics/computing)” cards
- **Wikipedia**: article in 13 languages
- **Wikidata**: [Q2984985](https://www.wikidata.org/wiki/Q2984985)
- **Wikipedia page views**: about 3,500 a month (November 2025 – October 2026)

Fame score: Wikipedia page views (July 2015 – October 2026, 39 languages). Updated November 23, 2026.

![Conditional operator](https://upload.wikimedia.org/wikipedia/commons/thumb/a/a3/Operator_warunkowy_c%2B%2B.jpg/960px-Operator_warunkowy_c%2B%2B.jpg)

*Photo: Pauliczczi, CC BY-SA 4.0 ([Wikimedia Commons](https://commons.wikimedia.org/wiki/File:Operator_warunkowy_c++.jpg))*

## Conditional operator: summary

In computer programming, the ternary conditional operator is a conditional expression with three parts: the Boolean condition, the then-expression, and the else-expression. If the condition is true, the then-expression is evaluated; otherwise, the else-expression is evaluated; and the value is returned. Thus it is a non-strict operator, like other conditional expressions.

Source: [Wikipedia](https://en.wikipedia.org/wiki/Ternary_conditional_operator) ([CC BY-SA 4.0](https://creativecommons.org/licenses/by-sa/4.0/))

## More cards: Computing

- [Arutz Sheva](https://didyouknow.cards/c/143814648) — Israeli media network
- [Kristen Nygaard](https://didyouknow.cards/c/92744) — computer scientist, Mathematician
- [PLA Unit 61398](https://didyouknow.cards/c/4942294) — China PLA advanced persistent threat unit which is alleged to be sources of cyber attacks
- [Du](https://didyouknow.cards/c/142120867) — standard Unix program used to estimate file space usage
- [OpenCart](https://didyouknow.cards/c/142133521) — CMS OpenCart - eCommerce platform for creating open source online stores
- [Douglas Crockford](https://didyouknow.cards/c/3037998) — American computer programmer
- [Olivetti Programma 101](https://didyouknow.cards/c/979393) — 1965 programmable calculator manufactured in Italy
- [David May](https://didyouknow.cards/c/574121) — English association football player
- [Loongson](https://didyouknow.cards/c/615955) — Chinese microprocessor manufacturer
- [Power Mac G4 Cube](https://didyouknow.cards/c/142104508) — personal computer by Apple
- [Wang Laboratories](https://didyouknow.cards/c/1206799) — American computer company
- [Page (computer memory)](https://didyouknow.cards/c/143825381) — fixed-length contiguous block of virtual memory

- [Calibre](https://didyouknow.cards/c/747793) — No. 2,209 of the “Computing” cards
- [Over-the-air update](https://didyouknow.cards/c/143795154) — No. 4,517 of the “Computing” cards
- [Bitstamp](https://didyouknow.cards/c/143849931) — No. 5,417 of the “Computing” cards
- [EURid](https://didyouknow.cards/c/143922078) — No. 8,834 of the “Computing” cards

[The best-known of the 15,859 “Computing” cards](https://didyouknow.cards/topics/computing)

## This card's topics

- [Computing](https://didyouknow.cards/topics/computing) (15,859 cards)
- [C/C++](https://didyouknow.cards/topics/c-c) (129 cards)
- [Science](https://didyouknow.cards/topics/science) (6,388 cards)

“Conditional operator” is one of the 4,515,532 cards of Did you know Cards, the free Wikipedia card game where you learn as you play: every card is a piece of knowledge from Wikipedia. Open boosters, complete your albums and challenge other players to duels.

---

Did you know Cards: https://didyouknow.cards/c/143813638
