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
You have installed a point-to-point connection using wireless bridges and Omni directional antennas between two buildings. The t
kozerog [31]

Answer and Explanation:

Omnidirectional antenna are those antennas which receives the signals from multiple directions equally.These are the antennas that cannot  get the signal from a particular direction thus gives the low throughput.

To get high throughput, directional antennas should be installed because they receive the signal from a particular direction only .Thus the signal received from these antenna work for a certain area.Example-Television antenna at homes are directional antennas names as Yagi-uda antennas.

3 0
4 years ago
What is the one common feature that ties together different social media technologies? All of the social media tools we use toda
xxTIMURxx [149]
They provide an intersection between technology, social interaction, and the sharing of information
8 0
3 years ago
Read 2 more answers
QUESTIONS Which of the following use cases are suitable for compute-optimized cloud offering? ОА. None of the listed O B. Highly
Ede4ka [16]

Answer:

E. All of the listed ​

Explanation:

For compute-optimized cloud offerings like AWS, suitable use cases are - gaming, distributed analytics, and scientific modeling. Since all these are suitable, the correct answer is E.

4 0
3 years ago
Name the following hardware device to write the data from hard disk to CD ​
lys-0071 [83]

Answer:

CD Writer or DVD Writer

Explanation:

The DVD Writer/CD Writer is a multipurpose rewriteable drive that can read audio, data, and video files and can record, or write, in both CD and DVD formats. This DVD Writer/CD Writer drive enables you to: Create custom audio, data, and video files that can be recorded onto CDs or DVDs. Store large amounts of data.

7 0
4 years ago
Write a java program that asks the user to enter a series of integers. when they enter a value of 0, the program should end. if
irina [24]

I have know idea so I guess ask the teacher?
4 0
3 years ago
Other questions:
  • Select the different network functions from the list below.
    10·1 answer
  • Consider the following code segment:
    8·1 answer
  • What is the average time a caller waits for an operator to answer?
    7·1 answer
  • Create a Produceclass that hasan instance variable of type Stringfor the name, appropriate constructors, appropriate accessor an
    13·1 answer
  • Assume user_name equals "Tom" and user_age equals 22. What is printed on the console when the following statement is executed? c
    14·1 answer
  • What is wrong with a MOV BL, CX instruction?
    6·1 answer
  • Write some positive and negative impacts of computer in our daily life​
    5·1 answer
  • What are the steps in preparing a bootable USB installer?​
    11·1 answer
  • When you're writing for mobile devices, use ________ to present the most important information first and provide successive laye
    13·1 answer
  • The following image shows the number of orders Company A received in 2015-2020. A financial analyst wants to calculate the year-
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!