Showing posts with label Basic programs. Show all posts
Showing posts with label Basic programs. Show all posts

Wednesday, October 13, 2021

QBASIC Program to display simple interest (SUB/FUNCTION Procedure)

CLS
PRINT "Enter the following... "
INPUT "Principle : "; p
INPUT "Time : "; t
INPUT "Rate : "; r
i = (p * t * r) / 100
PRINT "Simple Interest (I) = "; i
END

QBASIC Program to calculate the area of triangle when three sides are given

CLS
INPUT "Enter the value of first side : "; x
INPUT "Enter the value of second side : "; y
INPUT "Enter the value of third side : "; z
s = (x + y + z) / 2
a = (s * (s - a) * (s - b) * (s - c)) ^ (1 / 2)

QBASIC Program to print the area of parallelogram (Using SUB/FUNCTION Procedure)

CLS
INPUT "Enter Breadth : "; b
INPUT "Enter Height : "; h
a = b * h
PRINT "Area of Parallelogram is : "; a
END

QBASIC Program to print the area of triangle (with SUB/FUNCTION Procedure)

CLS
INPUT "Enter Breadth : "; b
INPUT "Enter Height : "; h
a = 1 / 2 * (b * h)
PRINT "Area of Triangle is "; a
END

QBASIC Program to print the area of 4 walls (SUB/FUNCTION Procedure Demo)

CLS
INPUT "Enter Breadth : "; b
INPUT "Enter Height : "; h
area = 2 * h * (l + b)
PRINT "Area of 4 walls = "; area
END

Monday, October 11, 2021

Program to print square root & cube root of an input number (QBASIC)

1. Program to print Square Root of Given Number.

CLS
INPUT "Enter any Number : "; n
sr = n ^ (1 / 2)
PRINT "Square Root = "; sr
END

Program to print square & cube of an input number (QBASIC)

Program to print Square Number of Given Number.

CLS
INPUT "Enter any number : "; n
s = n ^ 2
PRINT "Square = "; s
END

QBASIC Program To check the given number is divisible by 4 or not (SUB & FUNCTION Procedure)

CLS
INPUT "Enter a number"; n
x = n MOD 4
IF x = 0 THEN
     PRINT "The given number is exactly divisible by 4";
ELSE
     PRINT "The given number is not exactly divisible by 4";

QBASIC program to display area of a rectangle by (SUB & FUNCTION Procedure)

CLS
INPUT "Enter Length : "; l
INPUT "Enter Breadth : "; b
area=l*b
PRINT "Area = "; area
END

QBASIC program to Print the Perfect Square numbers from 1 to 100 (1, 4, 9, 16, 25, 36, 49, 64, 81, 100)

In mathematics, a square number or perfect square is an integer that is the square of an integer. In other words, it is the product of some integer with itself. For example, 9 is a square number, since it equals 32 and can be written as 3 × 3.

CLS
FOR i = 1 TO 100
     n = SQR(i)

QBASOC Program to print whether the given number is Prime or Composite

CLS
INPUT "Enter any Number "; n
FOR i = 1 TO n
     IF n MOD i = 0 THEN c = c + 1
NEXT i
IF c = 2 THEN
     PRINT "Prime Number"

Program to print the given string in Reverse Order (QBASIC)

CLS
INPUT "Enter any String "; s$
FOR i = LEN(s$) TO 1 STEP -1
     r$ = MID$(s$, i, 1)
     b$ = b$ + r$

Friday, October 1, 2021

WAP to input any string and count total no. of consonant.

QBASIC Program to input any string from the user and count and print the total number of consonant letter. 

CLS
INPUT "Enter any String : "; s$
c = 0
FOR i = 1 TO LEN(s$)
      r$ = MID$(s$, i, 1)
      c$ = UCASE$(r$)

WAP to input any string and count total no. of vowels.

QBASIC Program to input any string from the user and count the total number of vowel letters from the given string and print the total number of vowel letter. 

CLS
INPUT "Enter any String : "; s$
c = 0
FOR i = 1 TO LEN(s$)
      r$ = MID$(s$, i, 1)
      c$ = UCASE$(r$)

[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...