PLDB
Languages Features Creators Calendar CSV Resources Blog About Donate Add Language
GitHub icon

Ternary operators

< >
let i = true ? 1 : 0
#include <stdio.h> int main(void) { printf("%d", 1 ? 1 : 0); }
Example from Python, Cython:
print(1 if 1 else 0)
Example from PHP:
<?php echo 1 ? 1 : 0;
Example from Kotlin:
// Since if statements are expressions println(if (true) true else false)
Example from C3:
int foo = x ? 1 : 0;

Languages with Ternary operators include JavaScript, C, Python, C++, PHP, Kotlin, TypeScript, Objective-C, Cython, C3, Tick C, cooC, Real-Time Concurrent C, Static Typescript

Languages without Ternary operators include HTML, XML, JSON, CSS, JSON5, Ion, Jule, JSONiq, JSON with Comments, Superjson, Hocon, Scroll, Jsonnet, Explorer

Read more about Ternary operators on the web: 1.

HTML of this page generated by Features.ts

hasTemplates.html 路 hasTernaryOperators.html 路 hasThreads.html

View source

PLDB - Build the next great programming language Search v2023 Day 157 Docs Acknowledgements Traffic Today Traffic Trends Mirrors GitHub feedback@pldb.com