|| BCA || Semter-1 || C Programming || Basic Of C || C in Hindi || Networkers Era || Kanpur ||

Опубликовано: 11 Июль 2026
на канале: Networkersera
242
6

The ternary operator in C is a shorthand conditional operator that allows you to write a conditional expression in a compact form. It is also sometimes referred to as the conditional operator.

Here's how it works:

1. condition is a Boolean expression that is evaluated first.
2. If condition is true (non-zero), then the expression_if_true is executed, and its value becomes the result of the entire ternary expression.
3. If condition is false (zero), then the expression_if_false is executed, and its value becomes the result of the entire ternary expression.

A number is said to be special number when the sum of factorial of its digits is equal to the number itself. Example- 145 is a Special Number as 1!+4!+5!=145.
A number is said to be Krishnamurthy Number when the sum of factorial of its digits is equal to the number itself. Example- 145 is a Krishnamurthy Number as 1!+4!+5!=145.