Answer:
A for loop can be used to make something repeat as many times as you program it to, but a while loop only stops when you complete the task, or a certain condition is met. So, if you program a for loop to fill a bucket six times it will fill the bucket six times.
Answer:
I think it is manage document.
Explanation:
managing helps us to organize things and write things with ease.
Answer:
The program is as follows:
<em>5 INPUT A,B</em>
<em>6 PROD = A * B</em>
<em>7 PRINT PROD</em>
<em>8 TOTAL = A + B</em>
<em>9 PRINT TOTAL</em>
<em>10 DIFF = A - B</em>
<em>11 PRINT DIFF</em>
<em>12 END</em>
Explanation:
This gets input for the two numbers
<em>5 INPUT A,B</em>
This calculates the product
<em>6 PROD = A * B</em>
This prints the calculated product
<em>7 PRINT PROD</em>
This calculates the sum
<em>8 TOTAL = A + B</em>
This prints the calculated sum
<em>9 PRINT TOTAL</em>
This calculates the difference
<em>10 DIFF = A - B</em>
This prints the calculated difference
<em>11 PRINT DIFF</em>
This ends the program
<em>12 END</em>
This isn’t even a question it’s just instructions for a question. can you elaborate???
Answer:
Option d is the correct answer for the above question.
Explanation:
- The first loop of the program has a second loop and then the statement. In this scenario, the second loop executes for the value of the first loop and the statement executes for the value of the second loop.
- The first loop executes 4 times, Then the second loop or inner loop executes n times for the n iteration of the first loop, for example, 1 time for the first iteration of the first loop, 2 times for the second iteration of the first loop and so on.
- Then the inner loop executes (1+2+3+4) iteration which gives the result 10 iterations.
- The sum initial value is 0 and the "sum++", increase the value of the sum by 1.
- So the value of the sum becomes 10 after completing 10 iterations of the inner for loop.
- Hence the 10 will be the output. So the Option d is the correct answer while the other is not.