Conditional operator.

mahamadjon000

Mahamadjon000

Posted on October 31, 2024

Conditional operator.

Conditional operator - Условное оператор (turnery operator) используется выбор между двумя значениями на основе условия.

Syntax of turnery

Condition ? A : B;

Примеры использования:

#include <iostream>

using namespace std;

int main()
{

int a = 5,b = 10;

int max = (a > b) << endl;

cout << "MAX NUMBER" << endl;


return 0;
}
Enter fullscreen mode Exit fullscreen mode

Здесь если a больше b переменной max присваивается a иначе — b.

💖 💪 🙅 🚩
mahamadjon000
Mahamadjon000

Posted on October 31, 2024

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related

setw() va setfill()
cpp setw() va setfill()

November 1, 2024

Variables & Data types
cpp Variables & Data types

October 29, 2024

Dasturlash
cpp Dasturlash

October 29, 2024

Conditional operator.
cpp Conditional operator.

October 31, 2024