Skip to main content

Qbasic Programs

1. WAP to find the area of rectangle.
CLS
INPUT "ENTER LENGTH" ; L
INPUT "ENTER BREADTH" ; B
AREA = L * B
PRINT "AREA OF RECTANGLE IS =" ; AREA
END

2.WAP to display the area of circle.
CLS
INPUT "ENTER RADIUS" ; R
A = 22/7 * R ^ 2
PRINT "AREA IF CIRCLE" ; A
END

3. WAP to find the area of square.
CLS
INPUT "ENTER LENGTH"; L
A = L ^ 2
PRINT "AREA OF SQUARE =" ; A
END

4. WAP to find the area of triangle.
CLS
INPUT "ENTER BASE" ; B
INPUT "ENTER HEIGHT"; H
A = 1/2 * B * H
PRINT "AREA OF TRIANGLE=";  A
END

5. WAP to find the volume of cylinder.
CLS
INPUT "ENTER RADIUS" ; R
INPUT "ENTER HEIGHT" ; H
V = 22/7 * R ^ 2 * H
PRINT "VOLUME OF CYLINDER=" ; V
END

6. WAP to input percentage and display pass or fail.
CLS
INPUT "ENTER PERCENTAGE"; P
IF P > = 40 THEN
PRINT "PASS"
ELSE
PRINT "FAIL"
END IF
END

7. WAP to input any number and check odd or even.
CLS
INPUT "ENTER ANY NUMBER" ; N
IF N MOD 2 = 0  THEN
PRINT "EVEN NUMBER"
ELSE
PRINT "ODD NUMBER"
END IF
END

8. WAP to input any number and check positive, negative or zero.
CLS
INPUT "ENTER ANY NUMBER" ; N
IF N > 0 THEN
PRINT "POSITIVE NUMBER"
ELSEIF N < 0 THEN
PRINT " NEGATIVE NUMBER"
ELSE
PRINT "ZERO"
END IF
END

9. WAP to input any number and check whether it is divisible by 5 or not.
CLS
INPUT "ENTER ANY NUMBER" ; N
IF N MOD 5 = 0 THEN
PRINT "THE NUMBER IS DIVISIBLE  BY 5"
ELSE
PRINT "THE NUMBER IS NOT DIVISIBLE BY 5"
END IF
END

10. WAP to display 5,10,15,....,50.
CLS
FOR I = 5 to 50 STEP 5
PRINT I
NEXT I
END

11. WAP to display 100,90,80,....,10.
CLS
I = 100
WHILE I > = 10
PRINT I
I = I - 10
WEND
END

12. WAP to display 2,4,6,8,....,20.
CLS
I = 2
DO WHILE I < = 20
PRINT I
I = I + 2
LOOP
END

13. WAP to display 50,45,40,...,5.
CLS
I = 50
WHILE I > = 5
PRINT I
I = I - 5
WEND
END

Comments

Popular posts from this blog

Rakshya bandhan

Raksha Bandhan is observed on the last day of the  Hindu lunar calendar  month of  Shraavana , which typically falls in August. [23]  On this day, sisters of all ages tie a cotton bracelet or amulet, called the  rakhi , [3]  around the wrists of their brothers, ritually affirming the bond and support of her brothers, receiving a gift from them in return, and traditionally investing the brothers with a share of the responsibility of their potential care. [24]  The expression "Raksha Bandhan,"  Sanskrit , literally, "the bond of protection, obligation, or care," is now principally applied to this ritual. It has also applied to a similar ritual in which a domestic priest ties string bracelets on the wrists of his patrons and receives gifts of money. [16] [25]  A ritual associated with Saluno includes the sisters placing shoots of barley behind the ears of their brothers. [13] Of special significance to married women, Raksha Bandhan is rooted ...

Tihar

Tihar  is the five days celebration. Tihar is the most celebrated festival after Dashain in Nepal. It is a five-day festival celebrated in late autumn. It has its unique ways of celebration.  There are various stories about the celebration of Tihar. One of the famous stories behind the celebration of tihar is related to Yama the god of death and his sister Yamuna. Yama had been staying away from his sister for a long time. His sister wanted to meet him so she asked various sources to visit him and ask him to give her a visit. She sent crow, dog, and cow and at the end she went herself to see her brother. She worshipped him with tika and flowers, she put him five colored tika. Yamuna made a circle with mustard oil, Dubo Grass (Cynodon Dactylon) and put Makhmali Mala (Globe Amaranth) and asked Yamaraj not to go till the oil, Dubo Grass and the flower gets dry. Therefore, every sister worships her brother keeping him in the circle of mustard oil, putting mala (garland) of ...

Fathers day(Kuse ausi)

Father, mother and teacher are given the place of God in Hindu religion. Father, Pita or Babu is guru, rakshak and the palankarta. That means father is teacher, protector and the savior. Father's day is the day of paying respect once again to him.  Father’s Day is also known as Kuse Ausi or Pitri Tirpani Aausi or Gokarne Ausi. This day Nepali people pay their homage to their father with their favorite food, clothing and other dad’s favorite stuff.  Mukh Herne means "to allow someone as our relative or give respect or to recognize the achievement of someone".  This is a special day, we recognize and pay respect to our father for his care and love to us (his children and family) during his life. Hence,  this day is called "Babu ko Mukh herne din” . The literal meaning of Mukh Herne is to see someone's face.  Kuse ausi is on Bhadra Krishna Ausi. Ausi is no-moon day.  This year father's day in Nepal  is on Bhadra 27, 2072, which i...