Question

For the below code, what will be printed? public class mathchar { public static void main(String[]...

For the below code, what will be printed?

public class mathchar

{

public static void main(String[] args)

{

int i = 81, j = 3, k = 6;

char w = 'f';

System.out.printf("%.2f\n", Math.sqrt(i));

System.out.printf("%.2f\n", Math.pow(j,k));

System.out.printf("%c\n", Character.toUpperCase(w));

System.out.printf("%c\n", Character.toLowerCase(w));

System.out.printf("%d\n", (int)(Math.random() * 21 + 6));

/* just tell range of possible values */

}

}

0 0
Add a comment Improve this question Transcribed image text
Answer #1

ANSWER: I have run your code and the output is :

terminateds mathchar Java Ap 9.00 729.00 public class mathchar 1 public static void main (String[ args) int i -81, 3 -3, x -

Add a comment
Know the answer?
Add Answer to:
For the below code, what will be printed? public class mathchar { public static void main(String[]...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT