c. Code will not compile d. None of the above

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter9: Advanced Array Concepts
Section: Chapter Questions
Problem 20RQ
icon
Related questions
Question
c. Code will not compile
d. None of the above
Transcribed Image Text:c. Code will not compile d. None of the above
System.out.print(i+",");
}
}
1-What will happen when you compile and run the following code?
Public class test (
Public static void main (string [] arg) {
Int i=0;
For (i=100; i<=0; i--10) {
}
100,90,80,70,60,50,40,20,10,0,
100,90,80,70,60,50,40,20,10,
90,80,70,60,50,40,20,10,0,
None of the above
2-What will happen when you compile and run the following code? (
Public class test {
Public static void main (string[] arg) {
For (i=0; i<10; i++) {
If(i%2==0)
System.out.print(i);
Code will print all even numbers between 0 to 10
Code will print all odd numbers between 0 to 10
M
Transcribed Image Text:System.out.print(i+","); } } 1-What will happen when you compile and run the following code? Public class test ( Public static void main (string [] arg) { Int i=0; For (i=100; i<=0; i--10) { } 100,90,80,70,60,50,40,20,10,0, 100,90,80,70,60,50,40,20,10, 90,80,70,60,50,40,20,10,0, None of the above 2-What will happen when you compile and run the following code? ( Public class test { Public static void main (string[] arg) { For (i=0; i<10; i++) { If(i%2==0) System.out.print(i); Code will print all even numbers between 0 to 10 Code will print all odd numbers between 0 to 10 M
Expert Solution
steps

Step by step

Solved in 4 steps

Blurred answer
Knowledge Booster
Graphical User Interface
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT