Conditional Operator

In this lesson, you will get acquainted with the conditional operator in C++.

Introduction

Let’s have a look at another form of the if-else statement.


The conditional operator evaluates the given condition and returns the result accordingly.


Syntax

The basic syntax of the conditional operator is:

Press + to interact

The basic syntax to store the value in the variable through the conditional operator is ...