answersLogoWhite

0


Best Answer
Answer

You're better off using a program like Visual Basic or C++ to do that. QBasic doesn't have very many capabilities.


AnswerQBasic is quite capable. It is certainly capable of solving a magic squares problem.
User Avatar

Wiki User

15y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

14y ago

'set both vertical/horizontal position on screen of where to print out the text message...

vertLinePos% = 13 '...set vertical screen position of text

horiTabPos% = 7 '...set horizontal screen position of text

'set text message...

message$ = "This is the message text to flash. (Press [SPACEBAR] key to stop...!)"

CLS '...(CL)ear the (S)creen

DO '...keep LOOP-ing UNTIL when user presses any IN-coming KEY to stop....

'print visible message, first...

LOCATE vertLinePos%, horiTabPos% '...print message in one same fixed place

PRINT message$ '...print message as text

FOR pauseCount = 1 TO 32767: NEXT '...pause to show message

'overwrite message with a series of blank spaces: " "...

LOCATE vertLinePos%, horiTabPos% '...print message in one same fixed place

PRINT STRING$(LEN(message$), " ") '...print message as blank spaces

FOR pauseCount = 1 TO 32767: NEXT '...pause to show message

LOOP UNTIL INKEY$ <> ""

END '...END of program/halt program code execution

This answer is:
User Avatar

User Avatar

Wiki User

12y ago

By 'create a matrix multiplication program'...

I'll assume you mean how to create a Times Tables number square:-

QBASIC Code/Start...

==>

CLS

PRINT "PROGRAM: Twelve Times Tables Number Square"

PRINT

FOR intTimes% = 1 TO 12

FOR intTables% = 1 TO 12

'*** calculate times tables sum...

sum% = intTimes% * intTables%

'*** format number of of spaces...

noOfSpaces% = 0

IF LEN(STR$(sum%)) = 2 THEN noOfSpaces% = 2

IF LEN(STR$(sum%)) = 3 THEN noOfSpaces% = 1

'*** set colors...

COLOR 8, 7

IF intTimes% = intTables% THEN COLOR 1, 4

IF intTimes% = 1 THEN COLOR 4, 11

IF intTables% = 1 THEN COLOR 4, 11

'*** print out times tables sum...

PRINT sum%; SPC(noOfSpaces%);

NEXT

PRINT

NEXT

END

<==

...QBASIC Code/End.

This answer is:
User Avatar

User Avatar

Wiki User

12y ago

type:

PRINT "I like chocalate!"

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How do you write a magic square program with basic?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

How do you write Square program using vb?

write a vb program to find the magic square


How do you write a program to find out the square and cube of first ten natural numbers in gw basic?

First you will need to have some basic programming knowledge. You can use this to help make the program that is needed.


Write C program using functions to simulate a Calculator with the basic functions - square root and reciprocal?

trytytytytytytytytrf 6 bcvvtgujhy6


How do you write a standard basic program?

That really depends on what sort of program you are trying to build, what do you want the program to do?


How do you write BASIC program to accept variables?

dim a input a


Write a program that input a positive integer and prints a triangle using for loop?

write a program that reads in the size of the side of square and then pints a hollow square of that size out of asterisks and blanks?


Write a c program to accept a numbers and generate square root cube and exponential values?

write a c program to accept a number and generate a square root cube and exponential values


A c program to square matrix?

A C program to square matrix is a math problem. In the math problem you write down all the outer boundary values of matrix in a circle, then write down the inner value.


How do you write a java program to find the square root of a number?

You can use the Math.sqrt() method.


Write a program in qbasic to make a hut using print statemant?

a triangle then a square :)


How do you write a program in visual foxpro?

Same with other Visual Basic program, programming in FoxPro will require you to have the right syntax.


How do you write a c program to find square of a no using call by value?

int square (int N) return N*N;