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
stellarik [79]
3 years ago
12

WRITE A JAVA PROGRAM TO PRINT THE PATTERN 13579 2468 357 46 5

Computers and Technology
1 answer:
Inessa05 [86]3 years ago
4 0

Answer:

import java.util.Scanner;

import java.lang.*;

class Main

{

  public static void main(String args[])

  {

     int n;

     //For capturing the value of n

     Scanner scanner = new Scanner(System.in);

     System.out.println("Enter the value of n:");

     //The entered value is stored in the var n

     n = scanner.nextInt();

     int k=1;

     printnum(n,k);  

  }

  public static void printnum(int n,int k)

  {

       if(n%2==0)

       {

       for(int i=k;i<=n-1;i=i+2)

            {

                System.out.print(i);

            }    

        System.out.println("");

       }

       else

        {

       for(int i=k;i<=n-1;i=i+2)

            {

                System.out.print(i);

            }    

        System.out.println("");

        }

      n--;

      if(n<=1)

      {

         System.exit(0);

      }

      else

      {

          printnum(n,k+1);

      }

   }

}

Explanation:

The program is self explanatory.

You might be interested in
Add comma(s) where needed, if needed.
guajiro [1.7K]

Answer:

My birthday, October 31, 2005, is on Halloween.

Explanation:

4 0
2 years ago
1. What are the biggest risks when using the public Internet as a Wide Area Network (WAN) or transport for remote access to your
enyata [817]

Answer:

The problems or risk when using a WiFi is that, hackers often have the ability to position themselves between the user and the end point connection. and once these hackers gains access to your information and privacy, u might lose important documents or contents.

It is of utmost importance that when an end user is using a public WiFi as a WAN, he/she must ensure to browse with VPN turned on, and the sharing options turned off.

Explanation:

Solution

One of the biggest risk with public WiFi is the ability or capacity for hackers to position themselves between you (user) and the point of connection. so instead of communicating directly with the hotpot, at several times you end up sending your information to the hacker.

The hacker also have access or privileges to every information you send out such as credit card information, emails and so on. once the hacker gains access to that information, you run into trouble.

As an end user when making use of public WiFi to ensure to browse with VPN (Virtual private Network) on and turned off sharing options

4 0
3 years ago
What is one of the limitations of marketing in social media?.
klemol [59]

One of the limitation of the social media marketing is the risk of negative comments that can hamper the marketing strategy and certainly hamper the sales.

<h3>What is marketing?</h3>

Marketing can be defined as the advertising of the services or products into the market for making the end user aware about the product. There are various marketing tricks that can help in increasing the sales of the products or services.

Learn more about marketing, here:

brainly.com/question/13414268

#SPJ1

3 0
2 years ago
What is output? Select all that apply. c = 0 while (c &lt; 10): c = c + 5 print (c) 0 1 2 3 4 5 6 7 8 9 10
Harlamova29_29 [7]

Answer:

5 10

Explanation:

that's the answer : 5 10

4 0
3 years ago
The advantage of using a spreadsheet is:
Rama09 [41]

because it's a good thing

5 0
2 years ago
Other questions:
  • What is the purpose of this diamond shape in a flowchart?
    8·1 answer
  • Which of the following is needed if a computer with the IP address 172.31.210.10/24 wants to communicate with a computer with th
    5·1 answer
  • If you have a list of words that you wish me to make into a bulleted list, you must first highlig or ______ The words with the c
    13·1 answer
  • Plz answer me will mark as brainliest ​
    7·2 answers
  • Why is it a mistake to put email addresses of people who don't know each other in the "To:" field?
    8·2 answers
  • What is the output of the following program? #include using namespace std; class TestClass { private: int val; void showVal() {
    5·1 answer
  • Write a program that uses for loops to perform the following steps: Prompt the user to input two integers: firstNum and secondNu
    15·1 answer
  • You turn your computer on and the computer will not boot up. What is something you should do to diagnose the problem?
    6·2 answers
  • I NEED THIS ASAP PLS
    12·1 answer
  • The arrangement of keys on a keyboard, QWERTY reflects the keyboard layout by ________. Group of answer choices using the letter
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!