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
Math,
4 months ago
Math,
4 months ago
Math,
4 months ago
Business Studies,
8 months ago
India Languages,
8 months ago
English,
1 year ago
Accountancy,
1 year ago
Computer Science,
1 year ago