Computer Science > QUESTIONS & ANSWERS > computer science questions and correct answers with written progams (All)
What are the two possible values for a boolean variable? Answer : True or False 2. System.out.println(b || !b); Answer : true 3. System.out.println( !b && ( 19 = = p) ); Answer : true 4. System... .out.println( (p!=29) && b && (p= =q) ); Answer : false 5. System.out.println( (q!=p) || b ); Answer : true 6. System.out.println( !!!b ); Answer : true 7. boolean c = ( b || ((p + 10)= = q) ); System.out.println(c || b && !b); Answer : true 8. boolean c = p = = q; System.out.println(c); Answer : false 9. !( (7>9) || (2= =2) && (8>2) && (3<22) || (16<=16) && (75!=18) ) Answer : false 10. What is output by the following? int x = 9, y = -3; if( !(x!=y) ) { System.out.println(“Fourscore and seven years ago”); } else { System.out.println(“our fathers brought forth…”); } Answer : our fathers brought forth... 11. What is output by the following? double j = 128.22, k = 129.22; if( (j++) = = k) j+=10; k+=10; System.out.println(j); System.out.println(k) [Show More]
Last updated: 2 years ago
Preview 1 out of 4 pages
Buy this document to get the full access instantly
Instant Download Access after purchase
Buy NowInstant download
We Accept:
Can't find what you want? Try our AI powered Search
Connected school, study & course
About the document
Uploaded On
Jul 31, 2021
Number of pages
4
Written in
This document has been written for:
Uploaded
Jul 31, 2021
Downloads
0
Views
93
In Scholarfriends, a student can earn by offering help to other student. Students can help other students with materials by upploading their notes and earn money.
We're available through e-mail, Twitter, Facebook, and live chat.
FAQ
Questions? Leave a message!
Copyright © Scholarfriends · High quality services·