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
Trava [24]
3 years ago
11

Write a for loop that assigns summedvalue with the sum of all odd values from 1 to usernum. assume usernum is always greater tha

n or equal to 1.
Mathematics
1 answer:
Lapatulllka [165]3 years ago
5 0
// Input value is usernum.
// This code snippet sums 1 + 3 + 5 + ... + usernum
//  The answer is stored in the variable summedvalue.

N = (int) (usernum+1)/2;    // maximum number of integers to be summed
int *v = malloc(N*sizeof(int));     //  allocate storage for array v

// Calculate the number of loop counts and assign array v..
count = 0;
k = 1;
while (1) {
       if (k>usernum) {   //  do not extend v beyond usernum
          break;
          }
       v(count) = k;        //  assign an odd integer to v, including usenum
       count++;
       k += 2;                //  k is an odd number
       if k>usernum {          // handle usernum as odd or even
          k = usernum;
          } 
 }
n = count;          // the size of array v.

// Calculate the sum in a for loop
summedvalue  = 0;               // initialize summedvalue
for (i=0; i<=n; i++) {
     summedvalue += v(i);
    }


You might be interested in
343 divided by 7 in long division
gayaneshka [121]
343 divided by 7 is 49

There are 49 groups of 7 in 343

The answer is 49
6 0
3 years ago
Help, please. I dont really understand
Ivenika [448]

Answer:

We can eliminate the second and third options because marking something up doesn't result in a number less than the original. Since we are told to select 3 options and there are 3 answer choices left we select the first, fourth, and fifth statements.

5 0
3 years ago
Melvin conducted a series of surveys asking political candidates about the number of constituents they mail literature to. Each
damaskus [11]

Answer:

361.09

Step-by-step explanation:

Explanation:

Calculate the standard error of the mean, SE, using this formula, where  is the standard deviation and n is the sample size.

For this situation, the sample size is 65, and the standard error of the mean is 44.8. Substitute these values into the formula, and solve for .

So the standard deviation is approximately 361.09.

5 0
3 years ago
Read 2 more answers
2/4 is more than 1/4?
Mazyrski [523]

Answer:

Yes!

Step-by-step explanation:

Yes, because 2>1.

4 0
3 years ago
Read 2 more answers
IV. Intercepts. Give the intercepts of the following linear equations. 1) 5x + 3y = 8 2) 10x + 6y - 12 = 4 3) 2x – 3y = 5 4) 3x
rosijanka [135]

Answer:

1)\frac{8}{3}

2)\frac{8}{3}

3)\frac{-5}{3}

4)2

Step-by-step explanation:

1) 5x + 3y = 8

 3y=8-5x

y=\frac{-5}{8} x+\frac{8}{3}

hence intercept is \frac{8}{3}

2) 10x + 6y - 12 = 4

10x + 6y  = 16

6y=16-10x

y=\frac{-10}{6} x+\frac{16}{6}

hence intercept is \frac{8}{3}

3) 2x – 3y = 5

3y=2x-5

y=\frac{2}{3} x+\frac{-5}{3}

hence intercept is \frac{-5}{3}

4) 3x + 2y = 1

2y=-3x+4

y=\frac{-3}{2} x+\frac{4}{2}

hence intercept is 2

3 0
3 years ago
Other questions:
  • 310 is 40% of what number
    7·2 answers
  • What is the equation of the line show In this graph? ASAP!! Please
    7·2 answers
  • What is 4 raised to the second power
    15·2 answers
  • Could anyone please help me FAST!
    10·2 answers
  • Evaluate the operations on the given functions, f(x) and g(x), in the provided table
    15·1 answer
  • Hannah says that 2.11 is a rational number. Gus says that 2.11 is a repeating decimal.
    13·1 answer
  • 2/3 + 3/4 write the answer in the simplest Form
    10·2 answers
  • The population of a city is 100,000. It doubles each decade for 5 decades. Select all
    14·2 answers
  • A city has a population of 350,000. The population has decreased by 30% in the past ten years. What was the population of the ci
    14·1 answer
  • How do you know if a probability is significantly high or significantly low?
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!