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
erastova [34]
2 years ago
15

Using the framework below add code to allow the loop to sum the odd numbers from 1 to 10 in the loop and print the sum out at th

e end. Recall that you can use modulo to determine if a number is odd or even. Your sum should make use of the loop counter or your own loop counting variable. So on the first loop if that integer number is an odd number, it should be added to the running total or sum variable. This should be done inside the for loop. Note that the loop counter starts at 1 instead of 0 in this case.
Your output should equal: 25 for this loop.


#include
< stdio.h >


int main(void)

{

int sum = 0;

for(int i = 1; i <=10; i++)

{

/* Your solution here */


}

printf("%d\n", sum);

return 0;

}//end main
Computers and Technology
1 answer:
Sergeu [11.5K]2 years ago
8 0

Answer:

Below

Explanation:

#include <stdio.h>

int main(void){

int sum = 0;

for(int i = 1; i <=10; i++){

   if (i % 2 != 0 ){

       sum += i;

   }

   }

printf("%d\n", sum);

return 0;

}//end main

You might be interested in
PLEASE HELP! WILL MARK BRAINLIEST!!
DaniilM [7]

Answer:

An apple a day keeps the doctor away...

3 0
3 years ago
Read 2 more answers
HELP ME PLEASE PLEASE PLEASE!!!! IM BEGING YOU!!!!
lora16 [44]

Answer:

Photo metadata is a set of data describing and providing information about rights and administration of an image. It allows information to be transported with an image file, in a way that can be understood by other software and human users.

Explanation:

4 0
3 years ago
What is the danger of open-source software when it comes to military robotics?
Murljashka [212]

Answer:

The issue with open source software is that it is usable (and editable) by anyone. When it comes to military robotics, the software that is used to run the robots must remain confidential. If it is not, anyone could take the software that the military is using to make their robots function and replicate it, which could be extremely dangerous.

Explanation:

Open source software is available to the general public.

Feel free to copy and paste this or put it into your own wording. Have a nice day!

4 0
3 years ago
g The machine in the problem has a byte-addressable memory of 216 bytes. The direct-mapped cache consists of 32 cache blocks, an
balu736 [363]

Answer / Explanation:

To properly answer this question, let us define some basic terms:

Byte: The term byte is the digital unit for information and mostly consists of eight bits. The byte used to be the number of bits used to encode a single character of text in a computer and for this reason it is the smallest unit of memory in many computer program

Cache: A cache can be refereed to as a software component that stores information or data for the purpose future recall. The data stored in a cache could be treated as a duplicate or a copy of a copy of another data stored elsewhere.

Now, with the understanding from the above definition, referring back to the narrative of the question asked, we have:

(1) 8 leftmost bits = tag; 5 middle bits = line number; 3 rightmost bits = byte number.

                                                          S

                                               Tag           Set slot           W            

Memory address = 16 bits       8                 5                  3

(2)  256 bytes.=2^8 or

      32 blocks * 8 byte = 256 byte

(3)   Because two items with two different memory addresses can be stored in the same place in the  cache. That is, The tag is used to distinguish between them.

(4) Line 3.

    Line 6.

    Line 3.

    Line 21

3 0
4 years ago
Which tool should Jules use to encourage her reader's interaction on her website? Jules should use the ________ tool to encourag
Fofino [41]

It seems that the answer to the blank space and what Jules needs to do is providing a commenting tool to encourage her reader’s interaction on her website.

One of the major obstacle that any website faces, especially blog ones, is to encourage user interaction with the website – instead of just having silent readers. One way to do this is by providing a commenting tool so that the visitors can respond to the blog entry.

8 0
3 years ago
Other questions:
  • Which destination ip address is used when an ipv6 host sends a dhcpv6 solicit message to locate a dhcpv6 server?
    15·1 answer
  • Which organization has published more than 300 Web standards, and encourages manufacturers to follow these standards, many of wh
    14·1 answer
  • In scratch the location of a sprite is defined by what?
    10·1 answer
  • As a photographer, what will be the driving force behind everything that you produce?
    13·1 answer
  • Which is true about TCP and UDP? Choose two answers.
    15·1 answer
  • On a piano, a key has a frequency, say f0. Each higher key (black or white) has a frequency of f0 * r^n, where n is the distance
    10·1 answer
  • What type of engineer is interested in designing, developing, and building different machines, devices, and tools? A.aerospace
    8·2 answers
  • By convention only, either the first usable address or the last usable address in a network is assigned to the router (gateway)
    11·1 answer
  • A profit of ₹ 1581 is to be divided amongst three partner P,Q and R in ratio 1/3:1/2:1/5.theshareof R will be?​
    10·1 answer
  • When you connect to an Access database, which entities are shown in the Navigator window?
    13·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!