answersLogoWhite

0

A function is set of instruction that perform some specific operation . There are two type of loops one is finite and other is infinite. A finite loop is one that end after finite runs and an infinite loop is one that never ends itself.

User Avatar

Wiki User

10y ago

What else can I help you with?

Continue Learning about Educational Theory

Write a program using while loop?

//program to find the factorial value f any number using while loop #include<stdio.h> void main() { int i,n,fact=1; printf("Enter the number\n"); scanf("%d",&n); i=n; while (i>=1) { fact=fact*i; i--; } printf("The factorial value=%d",fact); } the above is a program for calculating tha factorial value of any number which is entered by the user


Differences between digital differential analyzer and bresenham algorithm?

AnswerDDA uses float numbers and uses operators such as division and multiplication in its calculation. Bresenhams algorithm uses ints and only uses addition and subtraction. Due to the use of only addition subtraction and bit shifting (multiplication and division use more resources and processor power) bresenhams algorithm is faster than DDA in producing the line. Im not sure, though if i remember right, they still produce the same line in the end.One note concerning efficiency: Fixed point DDA algorithms are generally superior to Bresenhams algorithm on modern computers. The reason is that Bresenhams algorithm uses a conditional branch in the loop, and this results in frequent branch mispredictions in the CPU. Fixed point DDA also has fewer instructions in the loop body (one bit shift, one increment and one addition to be exact. In addition to the loop instructions and the actual plotting). As CPU pipelines become deeper, mispredictions penalties will become more severe.Since DDA uses rounding off of the pixel position obtained by multiplication or division, causes an accumulation of error in the proceeding pixels whereas in Bresenhams line algorithm the new pixel is calculated with a small unit change in one direction and checking of nearest pixel with the decision variable satisfying the line equation.BUT this error can be calculated and will not cause problems for typical line drawing applications. Lines longer than what fits on a typical computer screen (a few thousand pixels) will be identical to Bresenham lines when using 32 bit integers. Fixed point DDA also has another advantage: Since it does not require conditional jumps, you can compute several lines in parallel with SIMD (Single Instruction Multiple Data) techniques.


Write a qbasic program to print the squares and cubes of first 10 natural numbers?

10 CLS 20 FOR n = 1 to 10 30 PRINT n, n^2, n^3 40 NEXT n 50 PRINT: PRINT: PRINT "Touch 'x' to go again, any other key to end." 60 INPUT a$ 70 IF a$ = "X" or a$ = "x" THEN 10 80 END


In the Rosenthal study of academic bloomers the children who improved their performance over the year did so because of their teachers'?

Higher expectations and increased support. Teachers who believed in the students' potential and provided additional resources and encouragement helped them excel academically. This support created a positive feedback loop that motivated the students to work harder and achieve greater success.


What is the difference between artificial neural network and hidden Markov model methods?

An artificial neural network is a structure which will attempt to find a relationship i.e. a function between the inputs, and the provided output(s), in order that when the net be provided with unseen inputs, and according with the recorded internal data (named "weights"), will try to find a correct answer for the new inputs. Hidden Markov models, are used for find the states for which a given stochastic process went through. The main difference could be this: In order to use a markov chain, the process must depend only in it´s last state. For use a neural network, you need a lot of past data. After training process, neural networks are capable of predicting next states of the system based only on the last state. In addition, given the ability to measure the prediction error (for example, after actual event, signal or state has happend and was compared to prediction), the neural network is capable of adapting itself and capture online changes in the undergoing process to improve the model of prediction and decrease the estimation error for the next states. Theoretically such approach can eliminate the need in initial training, as the network started from some random model will eventually adapt itself to the actual process it tries to estimate given this feedback error loop and will start to make correct estimations / predictions after a certain amount of steps. In such setup one can assume that neural network can be used when no past data is available at all. In this case neural network build the model of the ongoing process "from scratch" based on the observations in the "online" mode.

Related Questions

What do you mean by finite and infinite loop explain?

what do you mean by looping?


How do you write a infinite for loop?

for(; ;);..this will do for an infinite loop


What are some strategies to avoid getting stuck in an infinite loop in Magic: The Gathering?

To avoid getting stuck in an infinite loop in Magic: The Gathering, players can use cards that have a clear win condition or a finite number of repetitions. Additionally, players can carefully track the number of times a loop has occurred and make sure to follow the game rules to prevent an infinite loop from happening.


What are the differences between iterations and loops in progamming?

A loop will loop for n iterations. Each times the program executes the code in the loop is an iteration.


A program with a loop that never ends is called an?

Infinite loop.


How do you loop a program in python?

An infinite loop might look something like: while 1==1: print("Infinite loop") as 1 is ALWAYS equal to 1.


What is an infinite loop in c plus plus?

An infinite loop is one sequence of commands that just repeats over and over again forever. When it comes to creating an infinite loop you can use the: for do while and do statements. using the keywords 'true'


When a VBScript loop control variable is not altered during loop execution what kind of loop may result?

An infinite loop.


What is the difference between finite open loop gain and closed loop gain?

In a closed loop system the gain without the feed back loop being closed is called open loop gain!!! e.g if forward gain is "A" and feed back factor is "B" then open loop gain is "AB" and closed loop gain will be [A/(A+B)]


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.


What are the release dates for Infinite Loop - 2012 II?

Infinite Loop - 2012 II was released on: USA: 24 November 2012 (internet)


The Loop it's best to be out of?

An infinite loop - one that never stops. Unless that is what you intended.