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
When planning the structure of a spreadsheet, columns are for _______ items and rows are for _______ items.
lbvjy [14]
I feel like its d the answer
4 0
3 years ago
Read 2 more answers
Emerson needs to tell his browser how to display a web page. Which tool will he use?
alina1380 [7]

Answer:

HTML

Explanation:

HTML stands for <em>"Hypertext Markup Language." </em>It allows the creation of electronic documents which use <em>semantics</em> to indicate a particular text. The different HTML elements are being separated by<em> "angle brackets" </em>in order to make up a tag. These tags are not visible, but they make it possible for the browser's page to be interpreted.

8 0
3 years ago
Read 2 more answers
Write a do-while loop that continues to prompt a user to enter a number less than 100, until the entered number is actually less
OLEGan [10]

Answer:

#include <iostream>

using namespace std;

int main()

{

   int userInput = 0;

   do {

       cout << "Enter a number (<100):" << endl;

       cin >> userInput;

   }

   while(userInput >= 100);

   cout << "Your number < 100 is: " << userInput << endl;

   return 0;

}

Explanation:

Inside the <em>do part</em>, ask user to enter a number and get that number.

In the <em>while</em>, check if the number is greater than or equal to 100. It is going to keep asking to enter a number until a number that is smaller than 100 is entered.

Print out the number that is smaller than 100.

8 0
3 years ago
Read 2 more answers
Sarah's research shows that business information management professionals also perform the duties of other professionals. Which
aev [14]

Answer:

Business information management professionals also perform duties of <u>management</u> information systems professionals

Explanation:

A career in business information requires a diploma or degree in business information management or business administration as well as being required to carry out the tasks of a management information systems (MIS) professional of which the knowledge required on data communications and computers can be obtained by completion of a certification or degree in MIS or an associate degree in information technology. In addition, a strategic management certification can further improve a career in business information management.

3 0
3 years ago
Customizable diagrams, including List, Process, and Cycle diagrams, are built into Word and can be found in
JulijaS [17]

Answer:

clip art

Explanation:

i hope this helps you

7 0
3 years ago
Other questions:
  • Suppose that you created an robot that was so advanced it could act independently in very complex situations. It made its own de
    9·1 answer
  • Describe at least three virus scanning techniques
    13·1 answer
  • When you use information hiding by selecting which properties and methods of a class to make public, you are assured that your d
    14·1 answer
  • The instructions in the language of alice are contained on ____ which you can drag and drop into place to ____ new programs
    8·1 answer
  • how do I delete my brainly account, my child signed up for it and nothing has been paid but I do not want the account to exist a
    7·2 answers
  • You are a network administrator for your company. The network consists of a single Active Directory domain. All servers run Wind
    7·1 answer
  • Koi jinda hei kya hello​
    13·2 answers
  • In this paper https://arxiv.org/pdf/2008.10150.pdf, I'm having a hard time understanding how the assignment in the picture is de
    10·2 answers
  • Glenda is searching airline schedules on HolApp, a mobile Web application. While browsing the application, a banner appears on t
    12·1 answer
  • Content area a leased asset will appear on the balance sheet as a long-term asset. true false'
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!