Advertisement
Guest User

Untitled

a guest
Feb 19th, 2020
198
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. Fill in the blanks to print "You rock!" if variable "a" is greater than 15, and variable "b" is less than or equal to 72.
  2.  
  3. int a = 144;
  4. int b = 33;
  5. if (a >___ 15 b <=___ ) {
  6. System.out.println("You rock!");
  7. }
  8.  
  9. What is the output of this code?
  10. int result = 0;
  11. for (int i = 0; i < 5; i++) {
  12. if (i == 3) {
  13. result += 10;
  14. } else {
  15. result += i;
  16. }
  17. }
  18. System.out.println(result);
  19.  
  20. What is the output of this code?
  21. int arr[ ] = new int[3];
  22. for (int i = 0; i < 3; i++) {
  23. arr[i] = i;
  24. }
  25. int res = arr[0] + arr[2];
  26. System.out.println(res);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement