EasyManua.ls Logo

Radio Shack TRS-80 Model 100 - Page 16

Radio Shack TRS-80 Model 100
210 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Enter the following program:
1121
PRINT
"HOW
",
"NOW
";
2121
PRINT
"BROWN";
"COW"
Would you guess what the output
of
this program will produce? When executed, the
display will show:
Hm~
Ok
1\IOlr-J
BFWWI\ICOW
The comma in line
10
caused the two strings HOW and NOW to be spaced several
columns apart. The semicolon between the two words
"BROWN"
and
"COW"
caused them
to
print without a space. Now
if
line
10
is retyped
so
that the comma
is
changed
to
a semicolon and the semicolon at the end of the statement
is
omitted,
1121
PRINT
"HOW";
"NOW"
2121
PRINT
"BROWN";
"COW"
the output would
be
HOW
NOW
BROWNCOW
The second PRINT statement produces output on the second line because the carriage
return after the first PRINT statement has not been suppressed with a semicolon or
comma.
If
you wanted
to
print the words on one line, neatly spaced one column apart,
you could rewrite your program
as
follows:
1121
PRINT
"HOW";
"NDW
";
2121
PRINT
"BROWN";
"CDW"
10

Other manuals for Radio Shack TRS-80 Model 100

Related product manuals