do statement; while (condition);
or
do { statements } while (condition);
#include <stdio.h>
int main() {
int i=0;
do {
// function here
i+=1;
}
while (i<100)
return(0);
}
#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
There is no 'loop' feature in the program.
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.
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.
void line(int length) { for(int i=0; i<length; ++i) std::cout<<'_'; std::cout<<std::endl; }
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<int>& v) { int total=0; int i=0; while( i<v.size() ) total+=v[i]; return total; }
using the program paint
you dont lol
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.
sometimes, it all depends on what program you are using.
* ** *** **** simply use dis... { int x,y; for(x=1;x<=4;x++) { for(y=1;y<=x;y++) printf("*"); printf("\n"); } }
They program them using code and Java.
It depends, what program are you using? Answer by editing this answer.