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
Your task is to identify three or more ways that big data is being collected on a regular basis, including one data collection m
attashe74 [19]

Answer:

Data is one of the most valuable resources today's businesses have. ... There are various data-gathering methods you can use with the help of your ... When it comes to data businesses collect about their customers, ... Third-party data offers much more scale than any other type of data, ... Big White Cursor.

Explanation:

4 0
3 years ago
What is one reason why a business may want to move entirely online?
andrezito [222]

Answer:

To focus on global market

Explanation:

Hope this helps! :)

3 0
3 years ago
Please help me, I honestly dont know what happened to my laptop.
Alex787 [66]
Restart the whole computer??
7 0
3 years ago
Read 2 more answers
How do i fix my this??
maksim [4K]

get a new monitor u cant


6 0
3 years ago
Read 2 more answers
What section in an ethernet frame will you find a Virtual Local Area Network (VLAN) header?
Vadim26 [7]

Answer:

Preamble

Explanation:

In the computer network , the ether-net is the frame of link layer protocol data. This frame is used ether net with physical layer of transport mechanism. The ether net frame is of different type.

  • The ether-net II
  • The Novel raw IEEE 802.3
  • IEEE 802.2 LLC
  • IEEE 802.2 SNAP

Each of the Ethernet frame started from Ether net header. It contains the source and the destination. The MAC address is called its first two address.

8 0
3 years ago
Other questions:
  • The times per second an audio file is converted from analog to digital is the ______. audio file format bandwidth sample rate wa
    5·2 answers
  • Which type of password would be considered secure?
    15·1 answer
  • What should be included in the closing portion of your letter or e-mail?
    12·2 answers
  • An information security ________ is a specification of a model to be followed during the design, selection, and initial and ongo
    11·2 answers
  • What are two types of formulas in Excel
    13·2 answers
  • A library function that can find one string inside another is:
    9·1 answer
  • Big films with big budgets typically have a few animators working on them. True False
    11·1 answer
  • What is a benefit of starting a new business from scratch?
    8·1 answer
  • A recursive method may call other methods, including calling itself. A recursive method has:
    7·1 answer
  • In the context of computer and network security, _____ means that a system must not allow the disclosing of information by anyon
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!