answersLogoWhite

0

How do you make a program in C using do-while loop?

Updated: 11/10/2020
User Avatar

Wiki User

14y ago

Best Answer

do statement; while (condition);

or

do { statements } while (condition);

User Avatar

Wiki User

14y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

10y ago

#include <stdio.h>

int main() {

int i=0;

do {

// function here

i+=1;

}

while (i<100)

return(0);

}

This answer is:
User Avatar

User Avatar

Anonymous

Lvl 1
4y ago

#include

#include

void main()

{

int a,b,c,d,e,total,name,i;

float avg;

clrscr();

i=1;

do

{

printf(“Enter the rollno: \n”);

scanf(“%d\n”,&rollno);

printf(“Enter the name of the student: \n”);

scanf(“%d\n”,&name);

printf(“Tamil=%d\n”,a);

scanf(“%d”,&a);

printf(“English=%d\n”,b);

scanf(“%d”,&b);

printf(“Maths=%d\n”,c);

scanf(“%d”,&c);

printf(“Science=%d\n”,d);

scanf(“%d”,&d);

printf(“Social science=%d\n”,e);

scanf(“%d”,&e);

total=a+b+c+d+e;

printf(“Total=%d”,total);

avg=total/5;

printf(“Average=%d”,avg);

i++;

}while(i

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How do you make a program in C using do-while loop?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

How do you make your video rewind in window movie maker?

There is no 'loop' feature in the program.


How does loop work?

In programming, a loop works by conditionally jumping to the start of the loop and repeating the instructions. If the condition evaluates false, execution continues to the next instruction, thus breaking out of the loop. We can also break out of a loop from within the body of the loop itself using another conditional jump which jumps out of the loop. If we jump backwards out of a loop we effectively create an intertwined loop, known as spaghetti code which is difficult to read and maintain. Structured loops help make it easier to digest the logic. In C, a jump is achieved using a goto and a label. However, structured loops using for, while and do-while statements make loops much easier to read and maintain.


How do you fix an infinite loop?

It comes from its name: it doesn't terminate, the user have to interrupt the program-run (in the worst case: power off the computer).The infinite loop is also used to program loops with non-easily-deterministically end-of-loop conditions.You write an infinite loop, such as for (;;) {statements}, and break out of the loop with the break statement when ready to terminate.


How do you make C plus plus program to draw a straight line using for loop method?

void line(int length) { for(int i=0; i&lt;length; ++i) std::cout&lt;&lt;'_'; std::cout&lt;&lt;std::endl; }


How do you make a c plus plus program using while loop to print a sum of digits?

Place the digits in an array (or vector) and use the loop to sum each digit to a running total initialised to zero. The following function demonstrates the loop: int sum_vector(std::vector&lt;int&gt;&amp; v) { int total=0; int i=0; while( i&lt;v.size() ) total+=v[i]; return total; }


How do you make a fakemon sprite?

using the program paint


How you can make a program using XL data?

you dont lol


How to write a program to show the counter that counts 1000000 in a second?

You need to know how long a loop of 1000000 takes to execute. If it executes in an appropriate fraction of a second, you can provide a sub-loop or no-op instructions to make up the difference. If it does not, you can not.


Does using Java make a computer accessible to viruses?

sometimes, it all depends on what program you are using.


How do you write a program to make asterisk isosceles triangle using for loop in c plus plus?

* ** *** **** simply use dis... { int x,y; for(x=1;x&lt;=4;x++) { for(y=1;y&lt;=x;y++) printf("*"); printf("\n"); } }


How do people make minecraft mods?

They program them using code and Java.


How do you make your button work on your website?

It depends, what program are you using? Answer by editing this answer.