plz answer fast!!! don't write irrelevant answers or else I'll report. plz
Attachments:
Answers
Answered by
1
- Write the following code using ternary operator.
Given code,
double num=5.5;
String result;
if(num>0.0)
{
result="positive";
}
else
{
result="negative.";
}
The above code can be written using ternary operator as,
double num=5.5;
String result=(num>0.0)?"positive":"negative";
Answered by
0
Answer:
Given code,
double num=5.5;
String result;
if(num>0.0)
{
result="positive";
}
else
{
result="negative.";
}
The above code can be written using ternary operator as,
double num=5.5;
String result=(num>0.0)?"positive":"negative";
Similar questions
India Languages,
3 months ago
Math,
3 months ago
Social Sciences,
3 months ago
Business Studies,
7 months ago
India Languages,
7 months ago
English,
11 months ago
Accountancy,
11 months ago
Computer Science,
11 months ago