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]
3 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]3 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
How to connect apple pencil 2 to ipad 8th generation?
stepladder [879]

Answer:

That pencil doesn't adjust to that ipad because those two aren't compatible

Explanation:

5 0
2 years ago
Microsoft's ____ is one of the major web-based development environments.
finlep [7]
The answer is ".NET" (had to increase character count to let me post).
4 0
3 years ago
For safety, the lights on your vehicle must be in good working condition. Which statement about
bija089 [108]
I think the answer is a but I am not for sure
7 0
3 years ago
Read 2 more answers
In a mobile phone network, how many times as strong would
steposvetlana [31]

Answer:

how many times as strong would what?

put your question in the replies to this answer and I'll gladly answer it

Explanation:

May I have brainliest please? :)

6 0
2 years ago
Comment if u wanna text me on behance
kow [346]

Answer:

what is behance? :)

Explanation:

4 0
3 years ago
Other questions:
  • Show what this program prints. Be exact and complete. Can you explain the behavior of each print statement? 1 2 3 4 5 6 7 public
    12·1 answer
  • To execute a prepared SQL statement, you can use the _______ and execute methods of the PDOStatement object to set parameter val
    9·1 answer
  • The user can set their own computer hostname and username. Which stage of the hardware lifecycle does this scenario belong to?
    6·1 answer
  • Give 4 examples of mnemonic codes, and what do they do?
    15·1 answer
  • You are comparing cryptographic solutions to implement at your organization. Which two items should you focus on when you are ev
    12·1 answer
  • Explain why agile methods may not work well in organizations that have teams with a wide range of skills and abilities and well-
    7·1 answer
  • Future Cell Tech, a company that produces cell phones, is always on top of the newest technology and is the leader in cell phone
    6·1 answer
  • Read-only memory chips are used to
    11·1 answer
  • Here’s my last question
    12·2 answers
  • Due TODAY!!! Can someone please help me!!!
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!