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
There is overlap in the subjects of study in the different information technology disciplines.
Korolek [52]

There is overlap in the subjects of study in the different information technology disciplines is a True statement.​

<h3>What is computer Science about?</h3>

There is found to be a lot of confusion about computer science and why it is said to be also called “computing”.

There is seen to be a lot of  allied computing-related fields, such as information systems and that of computer engineering.

Hence, There is overlap in the subjects of study in the different information technology disciplines is a True statement. because those subject have different topics.

Learn more about information technology from

brainly.com/question/25110079

#SPJ1

6 0
2 years ago
Read 2 more answers
What makes it possible for e-mail to be sent and received on a wide variety of devices, including cell phones, PDAs, laptops, an
Usimov [2.4K]

Answer:

Compatibility.

Explanation:

Email or electronic mail is a messaging system that allows for transmission of digital or electronic mails to computers within and to other networks through the internet.

Email applications are web based applications and are hosted on servers. The POP (post office protocol) and IMAP (internet messaging access protocol) are used to message the mails sent to a client on a server. The application is written with standards and protocols to ensure compatibility in all types of device form factor, so an email can be view in a laptops, smartphones etc.

4 0
3 years ago
Hello<br> mini crewmate :) ඞ
Art [367]

Answer:

Hi, thx for the free points, have a great day/night, and stay safe!ඞ

6 0
3 years ago
Read 2 more answers
Spreadsheets: what is a column?
Travka [436]

Answer:

a group of cells stacked upon each other; vertical group

4 0
3 years ago
Four kinds of information a writer must document are: _____. A) common knowledge information B) direct quotation summary of a di
Dmitry_Shevchenko [17]
<span>The four kinds of information a writer must document are: summary of a discussion, original ideas, common knowledge information, and direct quotation. These are the fundamental information one must seek in order to fully understand the document.</span>
6 0
4 years ago
Other questions:
  • Java - Given a String variable response that has already been declared, write some code that repeatedly reads a value from stand
    12·1 answer
  • Define a function below, get_subset, which takes two arguments: a dictionary of strings (keys) to integers (values) and a list o
    8·1 answer
  • Write a program to read in a two values row and col to initialize a 2D array using those values. Then create a function FindTran
    15·1 answer
  • Two technicians are discussing bleeding air from the brake hydraulic system. Technician A says to depress the brake pedal slowly
    10·1 answer
  • Which tables and fields would you access to determine which book titles have been purchased by a customer and when the order shi
    15·1 answer
  • Which of the following is an example of a complex formula
    8·1 answer
  • In a system where Round Robin is used for CPU scheduling, the following is TRUE when a process cannot finish its computation dur
    13·1 answer
  • A free open source audio editing software program is
    5·1 answer
  • In object-oriented analysis, an object is a member of a(n) _____, which is a collection of similar objects.
    11·1 answer
  • When a person's personal information is collected by other parties, it refers to the issue of
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!