Can you please show me step by step how you get the resultthat i provided at the
ID: 3618877 • Letter: C
Question
Can you please show me step by step how you get the resultthat i provided at the end of the question? PLEASE GIVE STEP BY STEP EXPLANATION. THANKS
public class Dem08{ public static void main(String[] args){ for(int i=0; i<3; i++){ for(int j=0; j<5; j++) if ((i+j)%2==0) System.out.print(’x’); else System.out.print(’-’); System.out.println(); } }
Answer: x-x-x -x-x- x-x-x
Can you please show me step by step how you get the resultthat i provided at the end of the question? PLEASE GIVE STEP BY STEP EXPLANATION. THANKS
public class Dem08{ public static void main(String[] args){ for(int i=0; i<3; i++){ for(int j=0; j<5; j++) if ((i+j)%2==0) System.out.print(’x’); else System.out.print(’-’); System.out.println(); } }
Answer: x-x-x -x-x- x-x-x
Explanation / Answer
% is used when we want to take reminder of divisonfor example 2%4 = 2now here is your codepublic class Demo8 { public static void main(String[] args) { for(int i=0; iRelated Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.