BASIC basic tutorial 02-11-2012, 03:24 PM
#1
BASIC is a family of general-purpose, high-level programming languages whose design philosophy emphasizes ease of use - the name is an acronym from Beginner's All-purpose Symbolic Instruction Code.
To program with BASIC you'll need to download QBasic
Basic elements of BASIC
BASIC "is made" from following elements
1.
Big letters of English alphabet: A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z
2.
"Decimal digits"
0,1,2,3,4,5,6,7,8,9
3.
Special symbols
. , ; # $ % & "
4.Symbols of arithmetic operations
+ - * / ^
5.Relation symbols
< > <= >= <> >< =
6.Symbols that make up the word in English
INPUT LET END FOR NEXT PRINT etc
Lets make a simple calculator
Begin with CLS (clear screen)
As you can see our code calculates the variables
With PRINT command we printed the results
Now we'll make program with condition
You can see that if a = 0 then our program will print Impossible to divide with zero
And if it isn't it will print the result
Lets list numbers from 1 to N (number we choose)
Lets make a program for squaring
A = X ^ 2 is squaring the number
I think these are basics
Can help to someone who wants to learn and for someone who is doing maths homework
To program with BASIC you'll need to download QBasic
Basic elements of BASIC
BASIC "is made" from following elements
1.
Big letters of English alphabet: A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z
2.
"Decimal digits"
0,1,2,3,4,5,6,7,8,9
3.
Special symbols
. , ; # $ % & "
4.Symbols of arithmetic operations
+ - * / ^
5.Relation symbols
< > <= >= <> >< =
6.Symbols that make up the word in English
INPUT LET END FOR NEXT PRINT etc
Lets make a simple calculator
Begin with CLS (clear screen)
Code:
CLS
INPUT "Input numbers";A,B
C = A * B
D = A - B
E = A / B
F = A + B
PRINT "Results are";C,D,E,F
ENDWith PRINT command we printed the results
Now we'll make program with condition
Code:
CLS
INPUT "Input numbers"A,B
IF A = 0 THEN
PRINT "Impossible to divide with zero"
ELSE PRINT "Result is";A/B
END IF
ENDAnd if it isn't it will print the result
Lets list numbers from 1 to N (number we choose)
Code:
CLS
INPUT "Input ending number";N
FOR I = 1 TO N
PRINT I
NEXT I
ENDLets make a program for squaring
Code:
CLS
INPUT "Input number";X
A = X ^ 2
PRINT "Result is";A
ENDI think these are basics
Can help to someone who wants to learn and for someone who is doing maths homework

![[+]](https://sinister.ly/images/modern/collapse_collapsed.png)