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(n) ____ path is a path used for external links that includes the complete address for the destination page, including the prot
algol [13]
An Absolute Path  Is the Answer
6 0
3 years ago
Help me pls!!! last question
monitta

Answer:

tina.left(90)

Explanation:

In code if you want your character to turn left you put "left" in your code and if you want your character to go right type "right" and so on and so on so your answer is tina.left(90)

8 0
3 years ago
Any fact or set of facts, such as the words in a letter to a friend or the notes in a song, can become computer ____.
Alina [70]

I think the answer is... data

3 0
3 years ago
Which wireless communication is typically limited to six feet of distance?
Tcecarenko [31]

Answer:

Bluetooth is a wireless communication    is  typically limited to   six feet distances

Explanation:

Bluetooth is one type of communication maximum it covers  10 meters to 30 meters.   but it is one to one communication made for data transactions.  After  25 meters of coverage on communication will be very slow on data transactions. But Bluetooth has also had a limitation.

IR.  It is one of communication where infrared technology used. It is like face to face communication and speed of data transaction limited and it is also one to one communication made for data transactions. Communication paired and covered very little distances.

NFC it is chip-based and covers very little in fact just to device meet each and communication started. And very it caries very little data during the data transactions. it is also one to one communication made for data transactions

RFID is one of communication and it is powerful to cover more areas with multiple connections at the same time. It has a limitation  in distance and it covers  like a net with a specific distance  

4 0
3 years ago
When replacing a system board in a laptop, which feature is a must?
Sphinxa [80]
I would use a dual core Becuase a quad can be too space consuming and it can overheat the computers software
6 0
2 years ago
Other questions:
  • If we have a priority queue storing approximately million numbers, and the bottom level is "full", which of the following statem
    9·1 answer
  • A hotel salesperson enters sales in a text file. Each line contains the following, separated by semicolons: The name of the clie
    11·1 answer
  • Which of the following is an Internet supervisory protocol? O DNS IP O both A and B O neither A nor B
    12·1 answer
  • A pair of single quotes ' will prevent the shell from interpreting any special character. True or False
    15·1 answer
  • Does anyone know the answer for this? I’m extremely confused.
    8·2 answers
  • PLEASE HELP!!!!
    6·2 answers
  • Python program oranges and apples 3.4.6 copy and paste would be nice
    7·1 answer
  • Office 365 ProPlus can be deployed to your enterprise. When doing so, which tool enables you to choose the language, hardware ar
    5·1 answer
  • Does analogue conversation take place in source as transmitter?
    5·2 answers
  • What is the purpose of application software policies? Check all that apply.
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!