answersLogoWhite

0

In GE BASIC, you can print odd numbers using a FOR-NEXT loop by specifying a starting point and incrementing by 2. Here’s a simple example:

FOR I = 1 TO 99 STEP 2
    PRINT I
NEXT I

This will print all odd numbers from 1 to 99. The STEP 2 ensures the loop only increments by 2, thereby producing only odd numbers.

User Avatar

AnswerBot

2mo ago

What else can I help you with?

Related Questions

Program to print wvwn numbers from 1 to 100 in gw basic?

In GW-BASIC, you can print even numbers from 1 to 100 using a simple loop. Here’s a sample code: FOR i = 1 TO 100 IF i MOD 2 = 0 THEN PRINT i NEXT i This program iterates through numbers 1 to 100 and prints each number if it is even (i.e., divisible by 2).


You want to write a simple without using pointer or array c program which will print greatest number when you give 20 number?

i want to write a simple without using pointer or array c program which will print greatest number when i give 20 number .........How far have you gotten so far?


Write a program that read phrase and print the number of lower-case letter in it using function of counting?

write a program that reads a phrase and prints the number of lowercase latters in it using a function for counting? in C program


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 from compaq laptop?

Use the option File / Print in the program you are using.


How do you make games using q basic?

RANDOMIZE TIMER rndNumber% = INT(RND * 100) + 1 winFlag% = 0 CLS PRINT "PROGRAM: Guess the number" PRINT PRINT "I'm thinking of a number between: 1-100. You've 7 guesses..." PRINT PRINT "Guess No" FOR eachGuessNo% = 1 TO 7 PRINT eachGuessNo%; "> "; INPUT "What is my number"; guessNum% IF guessNum% = rndNumber% THEN PRINT "Yes, correct guess; you WIN!" winFlag% = 1 EXIT FOR END IF NEXT IF winFlag% = 0 THEN PRINT "No, you guessed WRONG! I the computer WIN!" PRINT "My number was: "; rndNumber% PRINT PRINT "Again, Y/N"; yesNo$ DO yesNo$ = INKEY$ LOOP UNTIL yesNo$ <> "" IF UCASE$(LEFT$(yesNo$, 1)) = "Y" THEN RUN END


Program for print prime all number from 1 to 100 in foxpro?

Oh, what a lovely request! In FoxPro, you can create a program to print all prime numbers from 1 to 100 by using a loop to check each number for divisibility only by 1 and itself. If it meets this criteria, you can print it out on the screen. Remember, every number is unique and special, just like a happy little tree in a vast forest.


Write c program to print palindrome using string without using strrev strlen strcam?

sdfdg


How do you write a BASIC program to display whether the input number is prime or composite?

To write a BASIC program that checks if an input number is prime or composite, you can use a loop to test divisibility. First, prompt the user for a number and then check if it's less than 2 (which is neither prime nor composite). For numbers greater than 1, iterate from 2 to the square root of the number, checking if it divides evenly (using the modulus operator). If you find a divisor, the number is composite; otherwise, it's prime. Here's a simple example: INPUT "Enter a number: ", N IF N < 2 THEN PRINT "Neither prime nor composite": END IS_PRIME = TRUE FOR I = 2 TO SQR(N) IF N MOD I = 0 THEN IS_PRIME = FALSE EXIT FOR END IF NEXT I IF IS_PRIME THEN PRINT N; " is prime" ELSE PRINT N; " is composite"


Write a program in qbasic to make a hut using print statemant?

a triangle then a square :)


How can you use just basic to write a program?

You can use BASIC to write a program by leveraging its straightforward syntax and commands to perform tasks like input, output, and simple arithmetic operations. Start by defining your program with a clear structure, using commands like PRINT for output and INPUT for user interaction. Utilize loops and conditionals to control the flow of the program, and keep the code organized with comments for clarity. BASIC's simplicity makes it an excellent choice for beginners to grasp programming concepts effectively.


Program for check a number is even or odd using PYTHON language?

This program checks whether a number is odd or even. NOTE: This site removes formatting from answers. Replace (tab) with a tab or four spaces. #!/usr/bin/python print("Type a number.") n = input(": ") l = len(n)-1 even = ("02468") if n[l] in even: (tab)print(n, "is even.") if n[l] not in even: (tab)print(n, "is odd.")