The blog is all about computer science, technology-based, and computer programming.
Wednesday, November 3, 2021
Q-basic programs (To Find name, odd, even, series, multiplication table, divisible, a sum of even or odd numbers)
Q-basic programs (To Find name, odd, even, series, multiplication table, divisible, a sum of even or odd numbers)
1. How do you write a flowchart and QBasic code to generate series 5, 10, 15, 20, up to 10 terms?
CLS A=5 FOR I = 1 TO 10 PRINT A; A=A+5 NEXT I END
2. How do you write a program in QBasic to write a table of 1 to 10 number
CLS
FOR I = 1 TO 10
FOR J = 1 TO 10
PRINT J ;"*"; I ;"="; (J*I)
NEXT J
NEXT I
END
3. How do I write a QBASIC program for multiples of 9?
CLS
A =9
FOR I = 1 TO 10
PRINT A; "*";I; "="; ( A*I)
NEXT I
END
4. WAP To print my school name 100 times?
CLS A$ = "ENTER YOUR SCHOOL NAME" FOR I =1 TO 100 PRINT A$ NEXT I END
5. WAP To print my name 20 times?
CLS A$ = "ENTER YOUR NAME" FOR I =1 TO 100 PRINT A$ NEXT I END
6. How do you write a QBasic program to check whether a number is exactly divisible by 3 or 7?
CLS INPUT ''ENTER A NUMBER"; N IF N MOD 3 = 0 AND N MOD 7 = 0 THEN PRINT "THE NUMBER IS DIVISIBLE BY 3 OR 7" ELSE PRINT ''THE NUMBER IS NOT DIVISIBLE BY 3 OR 7" ENDIF
END
7. How do I write a QBasic program to print a table of 15?
CLS
A = 15
FOR I = 1 TO 10
PRINT A; "*"; I; "=" (A*I)
NEXT I
END
8. How would you write QBasic programs to print the first ten even numbers?
CLS
A = 2
FOR I = 1 TO 10
PRINT A
A = A+2
NEXT I
END
9. What is the program for even numbers between 1 to 20 in QBasic?
CLS
A = 2
FOR I TO 20
PRINT A
A = A+2
NEXT I
END
10. What is a program in QBASIC to find the sum of even numbers between 10 and 50?
CLS
FOR I = 10 TO 50 STEP-2
PRINT I
S = S+ 1
NEXT I
PRINT "THE SUM IS "; S
END
11. What are the steps to find the sum of 100 natural numbers in Q basic?
CLS
FOR I = 1 TO 100
PRINT I
S = S+ I
NEXT I
PRINT "THE SUM OF NATURAL NUMBER IS"; S
NEXT I
END
12. What is the sum of the first 100 even numbers?
No comments:
Post a Comment