Fifty-five and twelve hundreths
// 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);
}
476/2 = 238
238+94 = 332
238-94 = 144
332 seniors voted for the winner
Answer:
C
Step-by-step explanation:
Using Pythagoras' identity in the right triangle.
The square on the hypotenuse is equal to the sum of the squares on the other 2 sides, that is
x² + 32² = 48²
x² + 1024 = 2304 ( subtract 1024 from both sides )
x² = 1280 ( take the square root of both sides )
x =
=
= ×
= 16 → C
Answer:
6,346
Step-by-step explanation:
add add multiply and add