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
A data visualization tool that updates in real time and gives multiple outputs is called
strojnjashka [21]

Answer:

A data dashboard

Explanation:

3 0
2 years ago
Which of the following statements correctly describe a computer program?
Naddik [55]

Answer: A. It’s a robust way to find information

Explanation:

Hope this help.

3 0
3 years ago
Read 2 more answers
Select a correct statement regarding a hashing process.
kogti [31]

Answer:

a) It is used for authentication.

Explanation:

Hashing is a process of transforming a single key into another value. It generates the values using a mathematical algorithm. the outcome of this process is a hash value or a hash.

The hashing process is used for authentication.

The hashing process is not reversible.

The hashing process is used to create the digital signature.

The outcome of the hashing process is the hash value, not a message.

4 0
3 years ago
The short-range two-way communication technology behind contactless payments is called ____.
sasho [114]
Near field communication
4 0
1 year ago
When it comes to social media technologies and formal learning in the corporate environment, the only social media platform that
Andrew [12]

Ootions: TRUE OR FALSE

Answer: FALSE

Explanation: According to (Steer,2015) there are many platforms for learning and teaching purposes in corporate Organisations, they include PINTEREST,WIKI,GOOGLE+, LINKEDIN,TWITTER etc, The social media platforms are available for effective and efficient Communication and has been the main driving force for Businesses the world over.

These social media platforms have aided the growth and expansion of product marketing strategies and enhanced the over all business efficiency.

4 0
3 years ago
Other questions:
  • If you are unsure about what is or isn’t appropriate to wear to a new job, what is the best thing to do?
    13·2 answers
  • 2 ways to assign a value to a variable
    6·1 answer
  • Write the percentage 5 1/4 as a decimal​
    8·1 answer
  • Which environment variable affects the number of past commands used in the current shell session?
    14·1 answer
  • You are sending an email to a coworker requesting that the coworker perform a task. Where should you put your coworker's email a
    8·1 answer
  • Explain how SEO impacts the way you should interpret search engine results ???
    6·1 answer
  • What are the 5 characteristics of flowchart<br>​
    14·1 answer
  • A team member who feels uncomfortable when disagreeing with another team member is likely from a(n) _______(fill in the blank) c
    5·1 answer
  • PLEASE ANSWER AND HURRY I'LL MARK YOU BRAINLIEST!!<br><br><br>​
    9·1 answer
  • A text that presents an event and describe what happens as a result is an example of what text structure
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!