Monday, October 11, 2021

Program to print the Numeric Series 3, 10, 5, 16, 8 (Hill-stone Number)

Using FOR...NEXT

CLS
n = 3
FOR i = 1 TO 5
     PRINT n;
     IF n MOD 2 = 0 THEN
          n = n / 2

Program to Print the Fibonacci Series 1, 1, 2, 3, 5, 8 ... up to 10th term

Using FOR...NEXT

CLS
x = 1
y = 1
PRINT x; y;
FOR i = 1 TO 10
     z = x + y
     PRINT z;
     x = y

Write a program to print the numeric series 0.11111, 0.1111, 0.111 .... 0.1

Using FOR...NEXT

CLS
n = 0.11111
FOR i = 1 TO 5
     PRINT n;

WAP to print 0.1, 0.11, 0.111 .... up to 7th term.

Using FOR...NEXT

CLS
a = 0.1
FOR i = 1 TO 7
     PRINT a;

Write a program to print 5, 125, ... up to 7th term (QBASIC)

Using FOR...NEXT

CLS
n = 5
FOR i = 1 TO 7
     PRINT n;

Write a Program to Enter any two numbers and print average number

QBASIC Program to get any two numbers from the user and print the average. 

CLS
INPUT "Enter First Number: "; a
INPUT "Enter Second Number: "; b 
av=(a+b)/2

Write a Program to Enter any two numbers and display the sum

QBASIC Program to get any two numbers from the user and print their sum on the screen. 

CLS
INPUT "Enter First Number: "; a
INPUT "Enter Second Number: "; b 
s=a+b 

Friday, October 8, 2021

QBASIC File Handling Appending Data File Example

Write a program to add some new records in the existing data file STUDENT.DAT. The program should prompt to the user for adding next records. 

CLS
OPEN "STUDENT.DAT" FOR APPEND AS #1
DO
INPUT "Enter Name : "; n$
INPUT "Enter Class : "; c

QBASIC File Handling Read Data from Data File Example

Write a program to display all the records of data file STUDENT.DAT

CLS
OPEN "STUDENT.DAT" FOR INPUT AS #1
PRINT "Name", "Class", "Roll No", "Address"
DO WHILE NOT EOF(1)

QBASIC File Handling Write Data into Data File Example

Write a program to create a sequential data file STUDENT.DAT then, store Name, Class, Roll number, and Address of the student

CLS
OPEN "STUDENT.DAT" FOR OUTPUT AS #1
INPUT "Enter Name : "; n$
INPUT "Enter Class : "; c

[Download PDF] Computer Science Book Gread-10 in Nepali Language

 If you are searching for class 10 Computer Science in Nepali pdf for free download then you are at the right page. This book is soley publi...