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
photoshop1234 [79]
2 years ago
5

Write a short java method that takes an integer n and returns the sum of all the odd positive integers less than or equal to n.

Computers and Technology
1 answer:
umka2103 [35]2 years ago
3 0
Public int add2n( int n )
{
    int total;
    if( n % 2 == 0 )
        total = n--;

    while( n > 0 )
    {
        total += n;
        n -= 2;
   }
   return( total );
}

You might be interested in
Write a program that outputs "Hello World!".
tekilochka [14]
Print(“Hello World!”)

I hope this helps :) I’m sry is this what you wanted or were you looking for something else because I’m willing to help either way.
4 0
2 years ago
To change the backround color of a page, which tab would you use?
ivann1987 [24]
I have concluded the answer is a
4 0
3 years ago
Read 2 more answers
What option in the alignment settings for a cell should be used to put text in a diagonal fashion?
tigry1 [53]

Answer:

The orientation option

Explanation:

Orientation in excel allows you to rotate text in several different ways. We can used this option to spice things up a bit. There are several kinds of orientation. There is one where the orientation can be rotated and the other one where the text can be either be put in a vertical or diagonal fashion.

5 0
2 years ago
Read 2 more answers
Which of the following is not an ideal habitat for a strong time-management plan
Maurinko [17]
The answer to this question is, A. Cramming.


PLEASE MARK BRAINLIEST!! :)
5 0
2 years ago
Read 2 more answers
The order of precedence determine
Free_Kalibri [48]
The order of precedence is the hierarchical order in which calculations are conducted. The simplest example of this is the way you always multiply before you add numbers.
7 0
3 years ago
Other questions:
  • At the dsl local carrier's office, the __________ demultiplexes the data streams and converts them into digital data.
    10·1 answer
  • The technical relationship between inputs and outputs, which is needed to understand the difference between the short run and th
    5·1 answer
  • With respect to the general classes of computers, a ________ is the most expensive and most powerful kind of computer, which is
    7·1 answer
  • What are the advantages and disadvantages of the simulated link strategy?
    11·1 answer
  • How to Save Power-Point presentation as a single file Web page that can be uploaded to the World Wide Web ?
    14·1 answer
  • The sum of the elements of an integer-valued array recursively calculated as follows: The sum of an array of size 0 is 0; Otherw
    15·1 answer
  • Who creates Virus ? virus is not made for what?
    14·2 answers
  • Name two components required for wireless networking<br>(answer fastly)​
    12·1 answer
  • If you created a variable called name, what data type would that value be? Group of answer choices a float a string a Boolean an
    5·2 answers
  • Binary is best interpreted by a computer because ​
    12·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!