64 484
Assignments Done
99,1%
Successfully Done
In September 2018

Answer to Question #2765 in Java | JSP | JSF for wilfred muller

Question #2765
Write a java application that prints all even numbers from 2 to 50 with the aid of following specifiatiions start a new line after every multiple of 20 use for loop.
Expert's answer
class Evens
{
& public static void main(String[] args)
& {
int i=2;
int a=2;
while (i<=50)
{
& System.out.print(i+" ");
& i+=2;
& a+=2;
& if (a>20)
& {
& System.out.println();
& a=2;
& };
};
};

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions