answersLogoWhite

0


Want this question answered?

Be notified when an answer is posted

Add your answer:

Earn +20 pts
Q: How do you print numbers as even numbers in a loop in qbasic?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Basic Math

How do you print first 10 even number using for loop in q basic?

For N = 1 to 10 Print 2 * N Next N


How do you print 1 to 100 without using loop in php?

The best way to print the numbers 1 to 100 in PHP without using a loop is with the following code: echo implode("<br>", range(1,100)); You can replace the <br> with anything that you want to separate the numbers, such as dashes. I used a line-break in the example.


Write a programme to print first 10 even and odd numbers using if statement while loop?

#include<stdio.h> int main () { printf ("2 4 6 8 10 12 14 16 18 20"); return 0; }


What are the purpose of test condition in a loop statement in qbasic?

The purpose of using a 'test condition' inside of a loop statement/which is also called a 'conditional loop'; is to make the loop STOP counting. Otherwise, you would have gone and created what is known as being called an 'endless loop'; which just keeps on running really quite endlessly, forevermore...! To give a quick example, let's compare... CONDITIONAL LOOP EXAMPLE num% = 0 DO num% = num% + 1 PRINT num%; LOOP UNTIL num% = 3 END Output... 1 2 3 Press any key to continue... Here, when the LOOP's test condition is met: (num%=3); then, the loop stops counting up any further; the DO/LOOP block structure is broken out of; and, the final END statement will get executed. UNCONDITIONAL LOOP EXAMPLE Next, let's try re-writing the same above program; by removing the conditional statement part of the LOOP which says: (UNTIL num%=3)... num% = 0 DO num% = num% + 1 PRINT num% LOOP END Output... 1 2 3 4 5 6 7 8 9 10 11 12 .... ...because there is no conditional test statement to make the loop stop repeating itself; therefore, it just keeps on endlessly counting upwards, instead; the program never breaks out of the DO/LOOP block; and, therefore never gets to reach the final END statement. To make an 'unconditional loop' stop repeating itself inside of QBASIC IDE/Integrated Development Environment; then, use combination key press: [CTRL] + [BREAK]; and, this should make an 'endless loop' stop repeating itself any further; and, return you straight back to the Editor Screen where you can futher change/edit your code.


Write a basic program to sort ten numbers?

DIM nums(10) CLS FOR i = 0 TO 9 nums(i) = (RND * 10) + 1 PRINT nums(i) NEXT PRINT : PRINT "Press Enter to sort numbers" rem pause to look at numbers DO WHILE INKEY$ = "": LOOP CLS FOR loop1 = 0 TO 9 FOR loop2 = loop1 + 1 TO 9 IF nums(loop1) > nums(loop2) THEN SWAP nums(loop1), nums(loop2) NEXT NEXT FOR i = 0 TO 9: PRINT nums(i): NEXT

Related questions

What is odd loop?

Move the print out requesting the user to enter an integer outside of the for loop and it will only print once instead of each time around the loop. You'll need a way to save the even and odd numbers that you detect in the loop. One way is to have separate arrays to hold the even and the odd numbers as you go around the loop. Then at the end of the loop you can have more loops to print the contents of one array and then the contents of the other array. Another way is to concatenate the number onto separate Strings (even and odd) to be displayed after the data gathering loop.


How will you print 10 studens name by using while loop statement in QBasic?

cls input "enter a name"; a$ b=1 while b <=1 print a$ b = b+1 wend end


How do you generate a series 1 3 5. using qbasic?

There are multiple ways to generate that particular string, several more than can be listed in one answer. For example: CLS PRINT "1 3 5" or CLS REM An easy "1 through 5, odds only" FOR loop. FOR X = 1 TO 5 STEP 2 PRINT X; NEXT X or even CLS INPUT "Please type in a number series with no line breaks (spaces okay):", numbers$ PRINT numbers$


How do you do a nested loop using Qbasic?

There several methods: For/Next loop Do/While/Until loops You can have Do Loops within Do Loops.


How do you write a name using do while loop on QBASIC?

QBasic is a type of question basic 🤗🤗🤗🤗😅😂🤣😁😛


How do you print first 10 even number using for loop in q basic?

For N = 1 to 10 Print 2 * N Next N


How do you print 1 to 100 without using loop in php?

The best way to print the numbers 1 to 100 in PHP without using a loop is with the following code: echo implode("<br>", range(1,100)); You can replace the <br> with anything that you want to separate the numbers, such as dashes. I used a line-break in the example.


How do you print non-prime numbers in java?

Loop through some numbers - for example, 2 through 100 - and check each one whether it is a prime number (write a second loop to test whether it is divisible by any number between 2 and the number minus 1). If, in this second loop, you find a factor that is greater than 1 and less than the number, it is not a prime, and you can print it out.


Write a for next loop for even numbers beginning at 10 and ending at 50?

int i;for (i=10; i


Write an algorithm or draw a flowchart to display numbers from 100 down to 10?

n=100 loop until n = 9 print n n = n -1 end loop


How do you write a program in java to read ten numbers and print sum of ten integers?

Add the numbers into one variable as you read them in. But if you prefer, you can read the numbers into an array and then use a loop to add the numbers together.


How do you print square using for loops?

how to print "square" using for loop