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$
REMPATTERNS (not necessary) CLS FOR I = 1 TO 5 STEP +1 FOR J = 1 TO I STEP+1 PRINT J NEXT J PRINT NEXT I END Hope you find this helpful :)
cls a =1 for i = 1 to 5 print a; a = (a*10)+1 next i end
QBASIC CODE/START... ==== ...QBASIC CODE/END.
CLS a = 0 b = 0 FOR i = 1 TO 10 IF a = 0 THEN f = 1 END IF PRINT f b = a a = f f = a + b NEXT i END from : Parth jani parthjani7@yahoo.com
In QBASIC, the Sign function is used to determine the sign of a numeric expression. It returns -1 if the number is negative, 0 if the number is zero, and 1 if the number is positive. This function helps in making decisions based on the value's sign in conditional statements or calculations.
In QBasic, you can generate the series 5, 55, 555, 5555, 55555 using a loop. You can start with a variable initialized to 5 and repeatedly multiply it by 10 and add 5 in each iteration. Here's a simple example: FOR i = 1 TO 5 num = 0 FOR j = 1 TO i num = num * 10 + 5 NEXT j PRINT num NEXT i This code will output the desired series.
REMPATTERNS (not necessary) CLS FOR I = 1 TO 5 STEP +1 FOR J = 1 TO I STEP+1 PRINT J NEXT J PRINT NEXT I END Hope you find this helpful :)
cls a =1 for i = 1 to 5 print a; a = (a*10)+1 next i end
the next one is 1234
In QBasic, you can print even numbers using a simple loop. For example, you can use a FOR loop to iterate through a range of numbers and then check if each number is even by using the modulus operator (MOD). Here's a sample code snippet: FOR i = 1 TO 20 IF i MOD 2 = 0 THEN PRINT i NEXT i This code will print all even numbers from 1 to 20.
cls input "enter a name"; a$ b=1 while b <=1 print a$ b = b+1 wend end
QBASIC CODE/START... ==== ...QBASIC CODE/END.
In order to Download Qbasic you may do one, both or none of these two things: 1.) Go to "http://www.softpedia.com/get/Programming/Coding-languages-Compilers/Qbasic.shtml" and click download or 2.) use "Google.com" with the keywords Qbasic free download to find another website with a free qbasic downlaod.
First, the QBASIC language has been around for a very long time...over 15+ years; therefore, there are 'many' books which have been written which are related to covering learning/or else, working with the QBASIC programming language. -(BASIC, itself which is the 'original' programming language that QBASIC is based on has been around since the early 1960's...so, over 50+ years! QBASIC is meant to be 'backwards compatible' with running older BASIC code; thus, it is capable of running many of these older BASIC programs, as well.)- Some books are highly specific in content...such as those covering QBASIC 'graphics', only. The books listed below are a lot more 'general' in content. One is a short teaching book/and, the other is a short quick reference guide. I would very highly recommend both of these as being very useful to people who are 'beginners' new to learning programming. -(I would further suggest that *before* you buy them; hop along to Amazon online bookstore; and, search to find the titles/authors there...; then, read through the 'reviews' of what other people do have to say after having read each of these books.)- 1> TITLE: QBASIC The Language of DOS AUTHOR: Mike James SERIES: The Programmers Library ISBN: 1-871962-40-4 PAGES: 276 COST: £14.95 NOTE: Mike James is a superb author of programming related books; who gives very clear and simple explantions. This is a teach you how to program using QBASIC book. 2> TITLE: MS-DOS QBasic AUTHOR: Kris Jamsa SERIES: Microsoft Quick Reference ISBN: 1-55615-355-4 PAGES: 187 COST: £9.99 This is a QBASIC reference guide book; it's NOT a teach you how to program using QBASIC book; instead, it just lists all of the QBASIC keywords, alphabetically; so, that you can quickly and easily find any keyword you need; it also gives example codes so that you can type in the code to find out/and, see for yourself exactly how each command works.
CLS a = 0 b = 0 FOR i = 1 TO 10 IF a = 0 THEN f = 1 END IF PRINT f b = a a = f f = a + b NEXT i END from : Parth jani parthjani7@yahoo.com
In QBASIC, you can create squares from 1 to 10 by using a loop and the LINE statement. Here's a simple example: FOR i = 1 TO 10 LINE (10, 10 * i)-(10 + i * 10, 10 * i + i * 10), , B NEXT i This code will draw squares of increasing size, starting from 1x1 to 10x10, with their bottom-left corners positioned vertically. Adjust the coordinates in the LINE statement to position the squares as needed.
//to generate Fibonacci series upto a range of 200....(in C).... #include<stdio.h> main() { int a,b,c,i; a=0; b=1; printf("\n FIBONACCI SERIES .....\t"); i=1; while(i<=(200-2)) { c=a+b; printf("\t%d",c); a=b; b=c; i++; } }