Telegram Group 🔥🔥🔥 Get answers in minutes
Questions answered : 48 /50
Guy
Guy
Guy
Guy
Guy
+ 4981 more
Verified Answer verified

What will be the output of the program
public class Example
{
public static void main(String [] args)
{
double values[] = {-2.3, -1.0, 0.25, 4};
int cnt = 0;
for (int x=0; x < values.length; x++)
{
if (Math.round(values[x] + .5) == Math.ceil(values[x]))
{
++cnt;
}
}
System.out.println("same results " + cnt + " time(s)");
}
}

🗓 Aug 14, 2024

Answer is "same results 2 time(s)"

Comments and Discussions

You don't need to login to post your comment

Comments:
30
Views:
60k
Likes:
120k
221 votes
🌐 India
Same results 2 time(s)
Was this answer helpful?

Was your question answered?

Want to get famous? 📸

Answer question and get 🤩 high-lighted on our homepage.

Just Automated Logo

© 2017-2022 Foxoyo™
All rights reserved.

Facebook Connect with us