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
//WAP to print fibonacci series using do-while loop.? using System; class Fibonacci { public static void Main() { int a=1,b=1; int sum=0; Console.Write("Enter Limit:"); int n=Int32.Parse(Console.ReadLine()); Console.Write(a); Console.Write(b); do { sum=a+b; a=b; b=sum; Console.Write(sum); } while(sum<n); } } By-Vivek Kumar Keshari
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
the next no. in the series should be 19 so if we sum up the digits of 739 we get 19.
//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++; } }