Write a flowchart and C code for a program that does the following: Uses a do...while loop. Prints the numbers from 1 to 10 with a blank line after each number. (Hint: You'll need to use the newline character \n .)

Answers

Answer 1

Answer:

create the integer variable and initialize it to one, with the do statement, increment the variable by one and print it, then the while statement checks if the variable is less than or equal to 10.

#include <iostream>

using namespace std;

int main(){

   int i = 1;

   do {

       cout<< i << "\n";

       i++;

   }

   while (i <= 10);

}

Explanation:

The C++ source code initializes the integer variable i to one and increments and print the value if the value is less than or equal to ten. The do-while statement executes a block of code before the condition is implemented.

Answer 2

The flowchart and the program illustrate the use of do while loop.

The do while loop is used to perform repetitive operations

The C code where comments are used to explain each line is as follows:

#include <stdio.h>

int main () {

//This initializes the number to 1

   int a = 1;

//This begins the loop

   do {

//This prints the current number

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

//This increments the number by 1

       a = a + 1;

   }

//The loop is repeated as long as the number is less than or equal to 10

   while( a <= 10 );

   return 0;

}

See attachment for the flowchart

Read more about loops at:

https://brainly.com/question/14592816

Write A Flowchart And C Code For A Program That Does The Following: Uses A Do...while Loop. Prints The

Related Questions

HELP NEEDED ASAP!!!
Early mixing systems had some severe limitations. Which of the following statements best describes one of those
limitations:
1. They could not fast forward.
2. They could not edit.
3. They could not play more than one track at a time.
4. They could not play in reverse.

Answers

<8□}□{●{●{《{¤□■♡¤■▪︎gusygydfig8f6r7t8t437r7fyfu

What is a conditional Statement that causes the program to change its course​

Answers

Answer:

In computer science, conditional statements, conditional expressions and conditional constructs are features of a programming language, which perform different computations or actions depending on whether a programmer-specified boolean condition evaluates to true or false.

Explanation:

Other Questions
Find the inequality represented by the graph. How was Michael Phelps diagnosed with depression and anxiety? What signs and symptoms did he experience? What lead to his diagnosis? what instructions does Romeo tell the nurse to pass on to Juliet in act 2 scene 4 Two similar triangles are show below: If there are 22 students in a class and each student makes 4 posters how many posters will the class make Explain two of the processes of the mourning period in Judaism . (4 marks) Can u guys help me please I need a correct answer Globalization has increased the social consequences of health disparities.TrueFalse use the given function F(x)= 0.08x+4.02 to evaluate the values below a) f (12.6) = b) f (-1.09) = I am really stuck it would mean the world if you could help :) Which of the following was one ofthe negative contributions thePuritans made to America?A. The attitudes that resulted in the Salem WitchTrialsB. The idea that hard work is a good thingC. The belief in free education for all Pinckney's Treaty with Spain is considered a diplomatic highlight of Washington's administration because it: ceded (gave) Florida to Spain. withdrew Spain's military forces from the Caribbean. opened Spanish Caribbean ports to US trade. allowed the US to use the port of New Orleans. The total surface area of this cuboid is 112cm^2. Find the value of x.Please explain, dont just give the answer. base your answer to this question on the information below and on your knowledge of physics. A toy launcher that is used to launch small plastic spheres horizontally contains a spring with a spring constant of 50. Newtons per meter. The spring is compressed a distance of 0.10 meter when the launcher is ready to launch a plastic sphere. The spring is released and a 0.10-kilogram plastic sphere is fired from the launcher. Calculate the maximum speed with which the plastic sphere will be launched. how has 19 amendment impact on American society? What geographic features of Greece encouraged theindependence of Greek city-states?A) limited hill country and arid grasslandB) long coastlines and numerous seasC) high mountains and many islandsD) wide valleys and active volcanoes Which two elements weather rocks by smoothing them? Which two elements weather rocks by smoothing them? Temperature and plants Water and plants Water and wind Wind and ice please help me out!!! Write the equation in point slope form for the line that contains the points (-2,-3), (4,3) Mrs. Jordan combined a box of 32 red pencils with a box of 26 blue pencils. Then, Mrs.Jordan gave each of her 5 students the same number of pencils. How many pencilsremained after Ms. Jordan divided the pencils equally among her students What is the pH of a neutral solution?A. 4B. 3C. 7D. 14