please solve this.............
Attachments:
Answers
Answered by
1
- Rewrite the given code using ternary operator.
Given code:-
int a=100;
if(a>99)
num="Three digit";
else
num="Two digit";
This can be written using ternary operator as
int a=100;
num=(a>99)?"Three digit": "Two digit";
The ternary operator contains three operands.
Similar questions
Math,
3 months ago
Economy,
3 months ago
English,
7 months ago
Math,
7 months ago
India Languages,
11 months ago
Social Sciences,
11 months ago