187k views
1 vote
Write a Java program to print the result in the series 10, 15, 20……50?

2 Answers

5 votes

Answer:

Idk what the other person is saying but you can simply make a variable for the series then print it as System.out.println(Data1 + Data2 + Data3 + Data4);

That would print the data assigned to each of those variables.

Step-by-step explanation:

So say you did somthing like this:

int Data1 = 10;

int Data2 = 15;

int Data3 = 20;

int Data4 = 50;

Then you could print those values in your output using the println() method.

Hope This Helped!

User Ruberoid
by
7.3k points
5 votes
The series is adding by 5, so make a loop containing x=x+5, and then print x. this should loop every 5 numbers and print. Make sure to complete the loop with a counter to 10, because after 10 loops it will have reached 50. :)
User Jon Artus
by
7.3k points