1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
timofeeve [1]
3 years ago
13

Write a java program to print the following series: 1 5 9 13 17...n terms​

Computers and Technology
2 answers:
andrew11 [14]3 years ago
6 0

Answer:

In Java:

import java.util.*;

public class Main{

public static void main(String[] args) {

Scanner input = new Scanner(System.in);

int n;

System.out.print("Max of series: ");

n = input.nextInt();

for(int i = 1; i<=n;i+=4){

    System.out.print(i+" ");

}

}

}

Explanation:

This declares n as integer. n represents the maximum of the series

int n;

This prompts the user for maximum of the series

System.out.print("Max of series: ");

This gets user input for n

n = input.nextInt();

The following iteration prints from 1 to n, with an increment of 4

<em> for(int i = 1; i<=n;i+=4){</em>

<em>     System.out.print(i+" ");</em>

<em>}</em>

trapecia [35]3 years ago
4 0

Answer:

In Java:

import java.util.*;

public class Main{

public static void main(String[] args) {

Scanner input = new Scanner(System.in);

int n;

System.out.print("Max of series: ");

n = input.nextInt();

for(int i = 1; i<=n;i+=4){

   System.out.print(i+" ");

}

}

}

Explanation:

This declares n as integer. n represents the maximum of the series

int n;

This prompts the user for maximum of the series

System.out.print("Max of series: ");

This gets user input for n

n = input.nextInt();

The following iteration prints from 1 to n, with an increment of 4

for(int i = 1; i<=n;i+=4){

   System.out.print(i+" ");In Java:

import java.util.*;

public class Main{

public static void main(String[] args) {

Scanner input = new Scanner(System.in);

int n;

System.out.print("Max of series: ");

n = input.nextInt();

for(int i = 1; i<=n;i+=4){

   System.out.print(i+" ");

}

}

}

Explanation:

This declares n as integer. n represents the maximum of the series

int n;

This prompts the user for maximum of the series

System.out.print("Max of series: ");

This gets user input for n

n = input.nextInt();

The following iteration prints from 1 to n, with an increment of 4

for(int i = 1; i<=n;i+=4){

   System.out.print(i+" ");

}

Explanation:

You might be interested in
An example of hardware is a _____. a)word processor b)database c)motherboard d)internet
zubka84 [21]
Salutations!

<span>An example of hardware is a __________.

</span><span>An example of hardware is a motherboard. Hardware are physical feature of a computer that you can touch and see. The rest of the options listed are all software --- 

Software are list of commands listed by the computer, they are also features of computer, but you can't physically touch them.

Thus, your answer is option C.

Hope I helped :D</span>
5 0
3 years ago
Read 2 more answers
People read all caps in e-mails as _____. yelling important points necessary for readability all of the above
mezya [45]
Yelling is the correct answer
6 0
3 years ago
Read 2 more answers
What shooting position is commonly used when hunting with a shotgun?
amid [387]
Standing well for me I never miss a shot in that position

6 0
4 years ago
Read 2 more answers
The LCM of 4, 9, and 10 is _______.
Citrus2011 [14]
Answer: 180


Step by step explanation: brainlist??
5 0
3 years ago
Read 2 more answers
Abram needs to put multiple sets of data into the same type of calculations for different companies, so he will create a
Nesterboy [21]

Answer:

Themes, Cell Styles, Conditional Formatting, and Formulas

Explanation:

Got it right on Edg.

7 0
3 years ago
Other questions:
  • Explain a business scenario where management information systems plays a part.
    11·1 answer
  • In JAVA, answer the following:
    15·1 answer
  • Why do local variables lose their values between calls to the function in which they are
    5·1 answer
  • Universal Containers decided to start using salesforce for all its sales automation its current sales database has about 50 mill
    10·1 answer
  • Are Most job applications are online
    9·1 answer
  • Electronic business includes which of the following
    5·2 answers
  • A computer takes a lot of time to do complex calculation​
    9·1 answer
  • In this project you will write a set of instructions (algorithm). The two grids below have colored boxes in different
    9·2 answers
  • you are a bank loan officer. carter has to come into your office and applied for a loan for a car.you ran his credit report, and
    7·1 answer
  • Test unit 8 edhesive answers ​
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!