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
To have different formatting for odd and even rows, select the _____ option.
Ratling [72]
<span>To have different formatting for odd and even rows, 
The option is </span><span>First Column</span>
4 0
3 years ago
Help me asap ill give brainliest
kobusy [5.1K]

Answer:

Give me brainliest thanks

6 0
3 years ago
What acronym is used to reference the data link sublayer that identifies the network layer protocol encapsulated in the frame?
juin [17]

Logical Link Control is the data link sublayer that identifies the network layer protocol encapsulated in the frame. The acronym of Logical Link Control is LLC.

Therefore, the answer is LLC.

7 0
3 years ago
Where do you place the logical test argument in an IF function formula?
Inessa [10]

Answer:

The first argument listed after IF

Explanation:

When the two variables are listed next to each other, Excel will find and calculate the correlation between them.

8 0
3 years ago
Read 2 more answers
Respond to the following in three to five sentences. Select one netiquette guideline. Explain how this helps you draft more effe
slamgirl [31]

Answer:

Keeping as few emoji's as possible. This helps because lots of emoji's can make things confusing and/or annoying. This just means being kind to the person you're messaging and not making things confusing.

8 0
3 years ago
Other questions:
  • We can see spreadsheet results graphically by creating:
    15·1 answer
  • Which of these automotive repair areas helps the vehicle change speeds to operate efficiently under all conditions?
    5·1 answer
  • Exchanging which type of data uses the least bandwidth?
    7·2 answers
  • A reflexive pronoun is a pronoun
    6·1 answer
  • Explain what an IM is, and what is the technology shown in the accompanying figure
    7·2 answers
  • 1. Es un símbolo que indica que se ha de realizar cierta operación específica entre uno o varios
    6·1 answer
  • Computing devices translate digital to analog information in order to process the information
    12·1 answer
  • Can you guys help me with this coding assignments?
    10·1 answer
  • 45 points!!
    15·2 answers
  • Convert 12 bits to bytes​
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!