Question
Find the smallest of two numbers using ternary opeartor
Solution
β Verified
#include <stdio.h>
int main() {
int a = 15, b = 8;
int smallest;
smallest = (a < b) ? a : b;
printf("Smallest number is: %d\n", smallest);
return 0;
}
Click here to download practice questions on
Ternary Operator