? :,Conditional Expression or ternary operator
C Programming Language / Operators and Enums in C Language
1068Program:
#include "stdio.h" int main() { int a = 4; short b; /* example of ternary operator */ a = 10; b = (a == 1) ? 20: 30; printf( "Value of b is %d\n", b ); b = (a == 10) ? 20: 30; printf( "Value of b is %d\n", b ); }
Output:
Value of b is 30 Value of b is 20 Press any key to continue . . .
This Particular section is dedicated to Programs only. If you want learn more about C Programming Language. Then you can visit below links to get more depth on this subject.
# C Tutorials
# JAVA Tutorials
# HTML Tutorials
# Computer Fundamental
# Data Structure
# DBMS Tutorials
SQL
# C# Language
# R Language
# PHP
# Python
# Vue JS