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
Georgia [21]
3 years ago
6

Please use C programming to write a code segment as an answer. Instead of using an while-loop like the following code, please im

plement a code segment by using a do-while loop. What is the output of the code?
#include
void main()
{
int i = 0;
while (i < 5);
{
printf("%d ", ++i);
}
}
Computers and Technology
2 answers:
krok68 [10]3 years ago
5 0

Answer:

#include <stdio.h>

void main()

{

int i = 0;

do{

printf("%d ", ++i);

}

while (i < 5);

i=i+1;

}

}

Explanation

The #include needs to include something and that's the standard input and output which is coded has stdio.h

In the do while loop what it does is print the value of I while I is less than 5 and you increment I value so as to prevent infinite looping

Anna71 [15]3 years ago
4 0

Answer:

The program using do-while loop defined as follows:

Program:

#include <stdio.h> //include header file

int main() //defining main method

{

int i = 0; //defining integer variable i and assign value.

//defining do-while loop

do  

{

printf("%d", ++i); //print value

}while (i<5); //check condition  

return 0;

}

Output:

12345  

Explanation:

Output of given program:

In the given program, it will not print any value because in while loop semi colon is used which is not valid.

Program Explanation:

In the above C language program header file is included, which provides features to use basic function then the main method is defined inside this method an integer variable "i" declare, that holds a value which is "0".  In this method, the do-while loop is defined. In the do section, we print value and in the while block checks the condition which is i is less than 5.

You might be interested in
An operating system is defined as hardware that converts software into a useful form for applications.
marissa [1.9K]

Hardware that transforms software into a form that is helpful for applications is referred to as an operating system. False. Hardware conversion is done by software.

<h3>What is an operating system?</h3>
  • Computer hardware and software resources are managed by an operating system (OS), which also offers common functions for software programs.
  • Operating systems that use time-sharing plan activities to make the most of the system's resources.
  • They may also contain accounting software to allocate costs for processing time, mass storage, printing, and other resources.
  • An operating system (OS) is a piece of software that controls all of the other application programs in a computer after being originally loaded by a boot program.
  • Through a specified application program interface, the application programs seek services from the operating system (API).

To learn more about operating system, refer to:

brainly.com/question/22811693

#SPJ4

4 0
1 year ago
Often, a single source does not contain the data needed to draw a conclusion. It may be necessary to combine data from a variety
nlexa [21]

To measure the pollution of a particular river, one must take the sample of the river and take the sample of pure water, then draw the conclusion, it will tell the amount of pollution in the river water.

<h3>What is pollution?</h3>

Pollution is the mixing of unwanted or harmful things in any substance or compound.

Water pollution is the mixing of toxics and chemicals in water.

Thus, to measure the pollution of a particular river, one must take the sample of the river and take the sample of pure water, then draw the conclusion, it will tell the amount of pollution in the river water.

Learn more about pollution

brainly.com/question/23857736

#SPJ1

6 0
2 years ago
A finance company wants to upgrade its accounting software to a higher version. This version change requires a change in data fo
Alina [70]

Answer:

The answer to this question is option b which is data re-engineering.

Explanation:

In computer science, data re-engineering is a part of the software development life cycle(SDLC). In the SDLC the data re-engineering is a technique that provides the facility to increase the size of the data formats, design,data-view, etc. It is also known as the software development process in this process, there are seven-stage for software development. If we want to upgrade the software to use the data re-engineering technique so we used the software development process. We use only this process to develop the software because there is no other process to development. So the correct answer is data re-engineering

4 0
3 years ago
Read 2 more answers
A(n) __________ window is an open window hidden from view but that can be displayed quickly by clicking the window's program but
Alex787 [66]
Minimized window

The sign to click is a "-" sign (minus)
4 0
3 years ago
Help!! Best answer will get Brainliest!!
Eddi Din [679]

Answer:

answer(s):

-set goals

-select a topic

-write down research questions

Hope this helped and sorry for the bold. <3

Explanation:

6 0
2 years ago
Read 2 more answers
Other questions:
  • Which operating system became obsolete with the arrival of a more advanced graphical user interfaces
    6·1 answer
  • Technological _____ is the term used to describe the merging of several technologies into a single device.
    13·1 answer
  • #include &lt;iostream&gt;
    9·1 answer
  • Cell references in a formula are called _____.<br> a. assumptionsc. numbersb. valuesd. content
    11·1 answer
  • In no less than two paragraphs, explain the risks and compliance requirements of moving data and services into the cloud.
    11·1 answer
  • Write an algorithm that gets as input your current credit card balance, the total dollar amount of new purchases, and the total
    8·1 answer
  • Does any one here play destiny on xbox one
    12·1 answer
  • Can somebody help me with this please
    6·2 answers
  • Please help I will mark brainliest
    5·1 answer
  • What is cache memory?Mention its importance. ​
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!