In QBASIC, you can write a simple program to input the number 64751315 and sum its digits as follows:
DIM sum AS INTEGER
sum = 0
INPUT "Enter a number: "; number
FOR i = 1 TO LEN(number)
sum = sum + VAL(MID$(number, i, 1))
NEXT
PRINT "The sum of the digits is "; sum
This program prompts the user to input a number, iterates through each digit, converts it to an integer, and adds it to the total sum, which is then printed out.
Write a program that calculates the area of a triangle in QBASIC
a triangle then a square :)
In QBASIC, you can use the INPUT statement to read data for your name, age, and address. Here's a simple program example: DIM name AS STRING DIM age AS INTEGER DIM address AS STRING INPUT "Enter your name: ", name INPUT "Enter your age: ", age INPUT "Enter your address: ", address PRINT "Name: "; name PRINT "Age: "; age PRINT "Address: "; address This program prompts the user to enter their name, age, and address, then prints the collected information.
you do this 10 print "0112358132134" use the whole of the thing
Cls input "enter two no.s ",a,b sum=a+b print "sum = ";sum end
Write a program that calculates the area of a triangle in QBASIC
a triangle then a square :)
In QBASIC, you can use the INPUT statement to read data for your name, age, and address. Here's a simple program example: DIM name AS STRING DIM age AS INTEGER DIM address AS STRING INPUT "Enter your name: ", name INPUT "Enter your age: ", age INPUT "Enter your address: ", address PRINT "Name: "; name PRINT "Age: "; age PRINT "Address: "; address This program prompts the user to enter their name, age, and address, then prints the collected information.
To write a program in QBASIC to find the area of a square, you first need to prompt the user to enter the length of one side of the square. You can then calculate the area by squaring the length (multiplying it by itself) and finally display the result. Here's a simple example: INPUT "Enter the length of the side of the square: ", side area = side * side PRINT "The area of the square is: "; area
you do this 10 print "0112358132134" use the whole of the thing
Yes I can. I did it in QBasic about 15 years ago.
Cls input "enter two no.s ",a,b sum=a+b print "sum = ";sum end
the extensions of qbasic are that, there are only 80 pixels to write in the qbasic
Variables don't have inputs. A variable is a named memory location where a value may be read or written. You write a variable by assigning a value to it. The value may be obtained from user-input.
dim a input a
I think it's <>
just full it up when its at the E