0% found this document useful (0 votes)
65 views

Lesson 6class5 Qbasic

The document provides examples of QBASIC programs to calculate the perimeter of a square, area of a rectangle and circle, and to convert meters to centimeters. It also explains common QBASIC commands - PRINT displays text, END marks the end of a program, INPUT gets user input, and CLS clears the screen. Sample programs are given to find each calculation using basic math operations and input/output commands in QBASIC.

Uploaded by

Prakash Js
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
65 views

Lesson 6class5 Qbasic

The document provides examples of QBASIC programs to calculate the perimeter of a square, area of a rectangle and circle, and to convert meters to centimeters. It also explains common QBASIC commands - PRINT displays text, END marks the end of a program, INPUT gets user input, and CLS clears the screen. Sample programs are given to find each calculation using basic math operations and input/output commands in QBASIC.

Uploaded by

Prakash Js
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

QBASIC

I ) Write a QBASIC Program for the following:

1.To find the perimeter of a square


Ans:
REM PROGRAM TO DISPLAY PERIMETER OF SQUARE
CLS
INPUT “ENTER LENGTH”; L
P=4*L
PRINT “PERIMETER OF SQUARE ”; P
END

2.To find the area of a rectangle


Ans:
REM PROGRAM TO DISPLAY AREA OF RECTANGLE
CLS
INPUT “ENTER LENGTH”; L
INPUT “ENTER BREADTH”; B
A=L*B
PRINT “AREA OF RECTANGLE ”; A
END

3.To find the area of a Circle


Ans:
REM PROGRAM TO DISPLAY AREA OF CIRCLE
CLS
INPUT “ENTER RADIUS”; R
A = 3.14 * R ^ 2
PRINT “AREA OF CIRCLE ”; A
END
4.Write a program to convert the meters to centimetre
Ans:
REM PROGRAM TO CONVERT METERS INTO CENTIMETERS
CLS
INPUT “ENTER DISTANCE IN METER”,M
CM = M * 100
PRINT “DISTANCE IN CENTIMETER=”,CM
END

II) Explain the following QBASIC Commands:

1.PRINT :
PRINT Command is used to print the text in the output screen.
2.END :
END Command indicates the end of a program.
3.INPUT :
INPUT Command is used to get input from the user
4.CLS:
CLS Command is used to clear the screen.

You might also like