PRINT COMMAND WITH MATHEMATICAL OPERATORS:
in LOGO, there are four basic mathematical operations that can be performed:
OPERATION OPERATORS
Addition +
subtraction _
Multiplication *
Division /
let's use each operator and see how it will be used with the PRINT primitive.
Addition (+):
addition command is used when two (or more) numbers need to be added.
syntax: PRINT < nl > + < n2>
where <nl > and <N2> are two numbers that will be added to find their sum.
example: PRINT 2+3 =5
you can have as many numbers to add as you want, as shown in figure 2.
SUBTRACTION ( _ ):
subtraction command is used when difference of two ( or more ) numbers needs to be found. PRINT < nl > - < 2l >
where <nl> and <n2> are two numbers that will be subtracted to find their difference.
example, PRINT 30 _ 20 = 10
you can have as many numbers to subtract as you want, as figure 3 shows.
Multiplication ( * ):
multiplication command is used to multiply two ( or more ) numbers.
syntax: PRINT < NL > * < N2 >
EXAMPLE, PRINT 5 *6 = 30
Division ( / ):
Division command is used to divide the first number by the second.
Syntax: PRINT <NL> / <N2>
where <nl> is the dividend and <n2> is the divisor.
example: PRINT 30/6 = 5
Thursday, 9 April 2015
do you mean by print command with mathematical operators?
Related Articles :
explain by the application of computer in information technology?APPLICATION OF COMPUTER IN INFORMATION TECHNOLOGY: computer are used in many industrial fields. two main areas among them are: . ...
explain by the general OS particles?do you mean by open and close file?GENERAL OS PARTICLES: ...
describe various generation of computer?discussed by computer history.HISTORICAL REVOLUTION-A BRIEF HISTORY the first computer was perhaps Abacus, developed around 650 B.C.. in china it consisted of bead ...
deference by computer hardware and software?explain by introduction to hardware? INTRODUCTION TO HARDWARE : in the previous class we have already studied the de ...
what is keyboard?describe the enhanced keyboard and its segments. Keyboard Keyboard is the most commonly used input device. it is mostly used to enter text and numeric type data into the computer. th ...
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment