17
n=100 loop until n = 9 print n n = n -1 end loop
Poor Boy. We do not do your homework here.
A = 5do{statement;A = A + 1;} while (A < 10)
Using while loop, write a program which calculates the product of digits from 1 to 5 and also show these no's vertically.
QBasic is a type of question basic 🤗🤗🤗🤗😅😂🤣😁😛
n=100 loop until n = 9 print n n = n -1 end loop
int i;for (i=10; i
Wr
Poor Boy. We do not do your homework here.
Input a variable.
In Python, you can create loops using different constructs, such as the for loop and the while loop. These loops allow you to repeatedly execute a block of code until a specific condition is met. Here's how you can create loops in Python: for loop: A for loop is used when you want to iterate over a sequence of elements such as a list, tuple, or string. It executes a block of code for each item in the sequence. for item in sequence: # Code block to be executed Here's an example that prints the numbers from 1 to 5 using a for loop: for num in range(1, 6): print(num) 2 while loop: A while loop is used when you want to repeat a block of code as long as a certain condition is true. It keeps executing the code block until the condition becomes false. while condition: # Code block to be executed Here's an example that prints the numbers from 1 to 5 using a while loop: num = 1 while num
A = 5do{statement;A = A + 1;} while (A < 10)
You can use a PL/SQL block to display numbers from 1 to n in Oracle. Here's an example program: DECLARE n NUMBER := 10; -- Change this value to your desired n BEGIN FOR i IN 1..n LOOP DBMS_OUTPUT.PUT_LINE(i); END LOOP; END; / This code declares a variable n, then uses a FOR loop to iterate from 1 to n, printing each number using DBMS_OUTPUT.PUT_LINE. Make sure to enable output in your SQL environment to see the results.
Using while loop, write a program which calculates the product of digits from 1 to 5 and also show these no's vertically.
QBasic is a type of question basic 🤗🤗🤗🤗😅😂🤣😁😛
for(; ;);..this will do for an infinite loop
I suggest you write an outer loop, that loops through all the numbers from 1 to 50. Call the variable that controls the loop something like "number".Then, initially assume the number is a prime (with a variable such as "isprime"); and write another loop that compares whether the number is divisible by any number from 2 to number-1. Call the controlling variable "factor". If number is divisible by factor, then it is not a prime, and you can exit the loop. At the end of the inner loop, if the variable "isprime" is still true, then you print the number.