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
omeli [17]
3 years ago
14

program that reads numbers from scanf (keyboard) and then sums them, stopping when 0 has been entered. Construct three versions

of this program, using the while, do-while, and for loops.
Computers and Technology
1 answer:
Alex17521 [72]3 years ago
7 0

Answer:

Explanation:

I'm going to write three examples in C language:

int main() {

   int n, i, sum = 0;

   printf("Enter the number: ");

   scanf("%d", &n);

   for (i = 1; i <= n; ++i) {

       sum += i;

   }

   printf("Sum = %d", sum);

   return 0;

}

int main() {

   int n, i, sum = 0;

   printf("Enter a number: ");

   scanf("%d", &n);

   i = 1;

   while (i <= n) {

       sum += i;

       ++i;

   }

   printf("Sum = %d", sum);

   return 0;

}

int main() {

   int n, i, sum = 0;

   do {

       printf("Enter a number: ");

       scanf("%d", &n);

   } while (n <= 0);

   for (i = 1; i <= n; ++i) {

       sum += i;

   }

   printf("Sum = %d", sum);

   return 0;

}

You might be interested in
What is the result of the following code?<br><br> x=7//2+10%2**4<br><br> print(x)
spin [16.1K]

Answer:

3

Explanation:

We can split the expression into two sections

First Section:

7 // 2 = 3. Using the floor division we only utilize the integer part.

Second Section:

10 % 2**4 = 0**4 = 0

Bringing back the full version expression we have

3 + 0 = 3

7 0
2 years ago
Management of software development consist of?
JulsSmile [24]

Answer:

d. All of the above

Explanation:

A software can be defined as a set of executable instructions (codes) or collection of data that is used typically to instruct a computer how to perform a specific task and to solve a particular problem.

A software development life cycle (SDLC) can be defined as a strategic process or methodology that defines the key steps or stages for creating and implementing high quality software applications.

In Computer science, management of software development consist of;

a. Process: it involves the stages through which a software application is analyzed, designed, developed, tested, etc.

b. People: it refers to the individuals involved in the software development process.

c. Project: it's the entirety of the stages a software goes through before it gets to the end user.

5 0
3 years ago
Industry experts estimate about what percentage of communication is through body language?
OverLord2011 [107]
Communication is only 7 percent verbal and 93 percent non-verbal. The non-verbal component was made up of body language (55 percent) and tone of voice (38 percent).
This is what one of my teacher told me but I’m not 100% sure it’s right
7 0
2 years ago
Read 2 more answers
Which of these can be represented visually by a flowchart?
Mariana [72]

Answer:

i think its C.

if its wrong i'm truly sorry

Explanation:

4 0
3 years ago
Read 2 more answers
Please help me answer this<br><br>number 1..
beks73 [17]

Answer:

B. How well it conveys information

Explanation:

The most important thing is how we represent the data in a graphic to understand the purpose, we can make an example, but we're going to use the color, can be more effective in a weather chart, for temperatures or clouds, but in an organization, we can use color on red or green numbers, in this way to convey bad and good numbers.

4 0
3 years ago
Other questions:
  • The first computer (the eniac was how big
    8·1 answer
  • 5. The stage of engine operation when both the intake and exhaust valves are closed is the _______ stage.
    5·1 answer
  • What is the safest way to shut down a desktop or laptop computer?
    8·1 answer
  • Create a program that will read in a Salesperson name, employment status (1=Full-time AND 2=Part-time) and the sales amount.
    5·1 answer
  • A technician is building a thick client workstation that would be used to run a database and wants to ensure the best protection
    12·1 answer
  • The term integration mean?
    7·2 answers
  • Describe how a cell’s content and format attributes are related.
    13·2 answers
  • File names should be limited to 144 characters.<br><br> true or false
    12·1 answer
  • What is the primary way that social networks work? Multiple Choice providing a security system for communication online connecti
    5·1 answer
  • Should a UDP packet header contain both Sour Port # and Destination Port #?
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!