answersLogoWhite

0

What else can I help you with?

Continue Learning about Engineering

Infinite Loop in c?

There are four ways to create an infinite loop in C: for ( ;; ) { // means: for ever // ... } while (1) { // 1 is always true // ... } do { // ... } while (1); // 1 is always true again: // ... goto again; In each case, the body of the loop must include at least one conditional expression which allows the loop to exit at some point. However, if the condition can be expressed easily within a for or while statement, that is the best place to put it: up front where it belongs. Goto loops are best avoided given that structured loops are just as efficient and make code much easier to read and maintain.


What are Four ways of making fabric?

There is about five ways, to bond, quilt, weave, knit, or non-weave.


What is the difference between entry and exit controlled loops - in Java?

while loop and for loop are entry controlled loops as they check looping condition at the entry point. do while loop is exit controlled loop as it checks looping condition at exit point. shreeradha@yahoo.com


In java what is empty statement.Explain its usefulness?

An empty statement in Java is just that: a statement with nothing in it. There are typically two ways to represent this:A single semicolon ;An empty block {}The usefulness of this type of statement is limited. The main use that I can think of is to fulfill the statement required for a loop structure.Here is an example that I recently used:while (sf(++n) != i);This loop will constantly call the method sf with increasing values of n until the return value of sf(n) is equal to i. Each loop in Java must have some code to execute in the loop body. In this case, all necessary work is done in the condition, and so the mandatory loop body is an empty statement.While there may be other (more clear) ways of writing this bit of code, this is an example of where that empty statement can be used.


How do you compute the product of integers 1 to 10 in JAVA?

There are, of course, several ways to do this, but the simplest way is probably using a "for" loop: int product = 1; for(int i = 1; i<= 10; i++) product *= i;

Related Questions

What three ways are the routing table populated?

1. Do it yourself. 2. Don't do it yourself. 3. Don't have a routing table.


Where can one view crazy loop videos?

Crazy loop videos can be viewed in a variety of different ways. One can find them on sites such as YouTube and Vimeo. They can also be sought on crazy loop video blogs.


When was Four Ways to Forgiveness created?

Four Ways to Forgiveness was created in 1995.


How many pages does Four Ways to Forgiveness have?

Four Ways to Forgiveness has 228 pages.


How many ways to spell four?

There are three ways to spell four Fore-As in golf For-As in the opposite of against four as in the number


What are the four ways a mixture can be separated?

alot of ways


What are the four ways force and motion can move something?

the four ways are front back left or right


When was Four Ways to Scream Your Name created?

Four Ways to Scream Your Name was created in 2003-02.


What is the ISBN of Four Ways to Forgiveness?

The ISBN of Four Ways to Forgiveness is 0-06-105234-5.


C plus plus what do you do if im stuck in an infinite loop?

There are three ways out of a loop.1. Satisfy the loop ending condition2. Execute a break statement3. Terminate the programPerhaps you are not changing the value of the variable that is used in the loop ending condition. Perhaps you are using a variable, such as an unsigned int, decrementing it, and expecting it to go negative. Suggest you run the program in a debuger and step through the loop.


How many ways can you arrange four letters?

24 ways.


What is the theoretical probability of getting two tails?

The probability of getting two tails is 1/4. The probability of something happening is the answer to the question, "What fraction of the time will this happen?" It is the number of ways it can happen, out of all the different things that can happen. With two coin flips, these are all the things that can happen H H H T T H T T There is one way in which you can get two tails, out of four possible things that can happen. One out of four, or 1/4.