Quick Print – CSKC
Sign In

Search

siteicon
Solved Problem #CPP#2791 Back

Problem Statement - Ternary operator within cout chain for selective printing

Initialise a character variable. Now using the ternary operator within the cout chain of printing, print YES if initialised variable is Y and print NO if it is anything else.

Solution

		 

Run Output

YES
NO