Saturday, March 1, 2014

QBASIC PROGRAMS

                                                        QBASIC  PROGRAMS 

1.INPUT 15 NUMBERS AND PRINT THEM WITH THEIR SUM.



REM
CLS
DIM N(15)
FOR I=1 TO 15
INPUT"ENTER THE NUMBERS";N(I)
S=S+ N(I)
NEXT I
PRINT"THE ENTERED NUMBERS ARE";
FOR J= 1 TO 15
PRINT N(J)
NEXT J
PRINT"THE SUM IS";S
END



2.INPUT 20 NUMBERS AND PRINT THEM IN REVERSE ORDER.



REM
CLS
DIM N(20)
FOR I =1 TO 20
INPUT"ENTER THE NUMBER";N(I)
NEXT I
PRINT"THE NUMBERS IN REVERSED FORM ARE";
FOR J=20 TO STEP-1
PRINT N(J)
NEXT J
END


3.INPUT 25 NUMBERS AND PRINT ONLY EVEN NUMBERS WITH THEIR SUM.



REM
CLS
DIM N(25)
FOR I=1 TO 25
INPUT"ENTER A NUMBER";N(I)
NEXT I
PRINT"THE EVEN NUMBERS ARE";
FOR J=1 TO 25
IF N(J) MOD 2=0 THEN
S=S+N(J)
PRINT N(J),
END IF
NEXT J
PRINT"THE SUM IS";S
END

4.INPUT 20 NUMBERS AND PRINT ONLY EVEN NUMBERS.



REM
CLS
DIM N(20)
FOR I=1 TO 20
INPUT"ENTER A NUMBER";N(I)
NEXT I
PRINT"THE EVEN NUMBERS ARE";
FOR J=1 TO 20
IF N(J) MOD 2=0 THEN PRINT N(J)
NEXT J
END

5.INPUT 15 NUMBERS AND PRINT ONLY POSITIVE NUMBERS FROM THE NUMBERS GIVEN BELOW.
         10,20,-30,-40,19,45,32,-98,-78,34,-53,12,-9,-7,-8



REM

CLS
DIM N(15)
FOR I=1 TO 15
READ N(I)
NEXT I
DATA 10,20,-30,-40,19
DATA 45,32,-98,-78,34
DATA -53,12,-9,-7,-8
PRINT"THE POSITIVE NUMBERS ARE";
FOR J=1 TO 15
IF N(J)>0 THEN PRINT N(J)
NEXT J
END

6. INPUT 10 DIFFERENT NAMES AND DISPLAY ALL WHOSE NAME STARTS WITH "S".



REM
CLS
DIM N(10)
FOR I=1 TO 10
INPUT"ENTER A NAME";N$(I)
NEXT I
PRINT"THE NAMES STARTING WITH "S" ARE"
FOR J=1 TO 10
A$= UCASE$(LEFT$(N$(I),1))
IF A$="S" THEN PRINT N$(J)
NEXT J
END

7.INPUT 15 DIFFERENT NAMES AND DISPLAY ONLY THOSE NAMES WHOSE STARTING AND ENDING CHARACTERS ARE VOWELS.



REM
CLS
DIM N(15)
FOR I= 1 TO 15
INPUT"ENTER THE NAME";N$(I)
NEXT I
PRINT"THE NAMES WHOSE STARTING AND NDING CHARACTERS ARE VOWELS ARE";
FOR J=1 TO 15
A$=UCASE$(LEFT$(N$(I),1))
B$=UCASE$(RIGHT$(N$(I),1))
IF A$="A" OR A$="E" OR A$="I" OR A$="O" OR A$="U" THEN
'PRINT N$(J)
END IF
NEXT J
END

8.INPUT 10 DIFFERENT NUMBERS AND DISPLAY IN ASCENDING ORDER.



REM
CLS
DIM N(10)
FOR I=1 TO 10
INPUT"ENTER A NUMBER";N(I)
NEXT I
FOR K=1 TO 10
FOR J= 1 TO 10-K
IF N(J)>N(J+1) THEN SWAP N(J),N(J+1)
NEXT J
NEXT K
CLS
PRINT"THE NUMBERS IN ASCENDING ORDER ARE";
FOR J= 1 TO  10
PRINT N(J)
NEXT J
END

9.INPUT 10 DIFFERENT NAMES AND DISPLAY IN DESCENDING ORDER.



REM
CLS
DIM N(10) AS STRING
FOR I=1 TO 10
INPUT"ENTER THE NAME";N(I)
NEXT I
FOR K=1 TO 10
FOR J=1 TO 10-K
IF LEN(N(J+1)) THEN SWAP N(J),N(J+1)
NEXT J
NEXT K
CLS
PRINT"THE NAMES IN DESCENDING ORDER ARE";
FOR J=1 TO 10
PRINT N(J)
NEXT J
END

10.INPUT 15 DIFFERENT NAMES OF CAPITAL AND COUNTRY AND DISPLAY IN ASCENDING ORDER ACCORDING TO COUNTRY.



REM
CLS
DIM CN(15)AS STRING
DIM CAN(15)AS STRING
FOR I=1 TO 15
INPUT"ENTER THE COUNTRY NAME"; CN (I)
INPUT"ENTER THE CAPITAL NAME";CAN(I)
NEXT I
FOR K=1 TO 10
FOR J=1 TO 10-K
IF LEN(CN(J))>LEN(CN(J+1))THEN
SWAP CN(J),CN(J+1)
SWAP CAN(J),CAN(J+1)
NEXT J
NEXT K
CLS
PRINT"THE NAMES IN ASCENDING ORDER ARE";
PRINT"COUNTRY'S NAME","CAPITAL NAME"
FOR J= 1 TO 10
PRINT CN(J),CAN(J)
NEXT J
END

11.STORE NAMES AND MARKS OF 15 DIFFERENT STUDENTS AND PRINT THEIR NAME,MARKS AND DIVISION USING THE FOLLOWING CONDITION:


PERCENTAGE                                                                                DIVISION
>=80 AND <=100                                                                            DISTINCTION
>=60 AND<80                                                                                 FIRST DIVISION
>=50 AND <60                                                                                SECOND DIVISION
>=40 AND <50                                                                                THIRD DIVISION
<40                                                                                                    FAIL



REM
CLS
DIM N(15)AS STRING
DIM P(15)
DIM D(15)AS STRING
FOR I= 1 TO 15
INPUT"ENTER THE NAME";N(I)
INPUT"ENTER HIS/HER PERCENTAGE";M(I)
NEXT I
PRINT"NAME","PERCENTAGE","DIVISION"
FOR I=1 TO 15
IF P(I)>=80 AND P(I)<100 THEN
D(I)="DISTINCTION"
ELSE IF P(I)>60 AND P(I)<80 THEN
D(I)="FIRST DIVISION"
ELSE IF P(I)>=50 AND P(I)<60 THEN
D(I)="SECOND DIVISION"
ELSE IF P(I)>40 AND P(I) <50 THEN
D(I)="THIRD DIVISION"
ELSE
D(I)="FAIL"
END IF
PRINT N(I),P(I),D(I)
NEXT I
END

12.INPUT 10 DIFFERENT NAMES AND AGE OF STUDENT.AFTER THAT THE USER SHOULD ASK THE USER TO INPUT NAME TO SEARCH DATA.IF THE NAME IS NOT FOUND PRINT THE NAME AND AGE OF THE STUDENT OTHERWISE PRINT"DATA NOT FOUND"



REM
CLS
DIM N(10) AS STRING
DIM A(10)
FOR I= 1 TO 10
INPUT"ENTER THE NAME";N(I)
INPUT"ENTER HIS/HER AGE;A(I)
NEXT I
INPUT"ENTER THE NAME TO SEARCH DATA";.S$
FLAG=0
FOR I= 1 TO 10
IF UCASE$(S$)=UCASE$(N(I))
PRINT N(I),A(I)
FLAG=1
END IF
NEXT I
IF FLAG=0 THEN
PRINT"DATA NOT FOUND"
END IF
END

Sunday, February 9, 2014

CHITLANG


Chitlang is a VDC located in Makwanpur DistrictNarayani ZoneCDR, Nepal.

Chitlang is located to the south west of Kathmandu valley in mid-hills called Mahabharat range.
The VDC is bounded by-



  • North : Naubise VDC, Thankot VDC, Mahadevsthan VDC
  • South : Markhu VDC
  • East : Fakhel VDC, Matatirtha VDC
  • West : Bajrabarahi VDC



According to 2001 census of Nepal, there were 1170 houses in Chitlang and 5830 people. The main ethnic population are NewarTamang,Khas etc.
Chitlang has a rich Newar culture. The Chitlang dialect of Nepal Bhasa is spoken almost exclusively in this region. One of such language is Balami language.




Chitlang VDC is located in ancient Newar settlement. Inscriptions dating back to Lichchavi era have been found in this placeAn inscription was found in Toukhel, Ward 6 of Chitlang VDC, established by king Amshubarma (in sambat 37). According to the inscription, Amshubarma had given the land to shepherds and established a settlement for shepherds in Toukhel, Nhulgaun, Kunchhal etc. of Chitlang.



Some historians believe that these people called Gopalis are the descendants of rulers of Gopal era. in chitlang there is diferent culture in every plase, in ward no 1 there is tamang culture in waed no 2 khas, in ward no 3,4,5,10 and 6 there newari cluture same as 8,7 and 9 there mixed culture. there is many visiting place like "majhagau" specally newari people and culture,swachhand vairavr temple and satdhaea, argenacik resourte and soon.
chitlang is in the south direction from kathmandu. The place is about 30 km far from kathmandu valley.It is located in Makawanpur district of  Narayani zone in CEntral Development Region. 

The climatic condition of the place is neither too hot nor too cold that is the climate of chitlang is moderate.

Most of the people living in Chitlang are from Brahmun , chhetry , Newar and Tamang community.

Chitlang is famous for goat farming and for the cheese produced or manufactured with the use of goats milk.

Decidious and Coniferous forest are found in Chitlang which increasesthe natural beauty of the place.

Mushroom farming,Cheese production and cultivation of  different kinds of crop s like maize, wheat ,paddy etc are the main economic activities of the people in Chitlang.

The main production of Chitlang village is Goats milk and the Cheese which is produced from the milk of goat. Local people of Chitlang village earn their living through all these activities.

Chitlang is small yet beautifiul village of Makawanpur district,Nepal. This village liesin Narayani Zone of Central development region,Nepal.

Chitlang VDC has ancient newar settlement . This place is important historically as well because Inscriptions dating back to LIchhavi period ha sbeen uncovered in this place.

Chitlang is quiet near to the Kathmandu valley . It is located to ther south west of Kathmandu valey in the mid hills of Mahabharat range .

Taukhel is a small part of Chitlang which had been established by king Amshuberma. At the same place in Taukhel, ward number - 6
, an INscription was discovered which dated back to the period of Amshuberma.

According to the inscription , King Amshuberma had given lands to the shepherds and had wstablished a settlement for those shepherds in Taukhel , Nhulgan etc of Chitlang village.

The ancient name of Chitlang was "Chitrapur"
. According to this ancient name this village has been divided into 5 purs which are as follows,


  • Shudhapur
  • Chitrapur
  • Kalapur
  • Hastinapur
  • Champapur

Chitlang has a very moderate type of climate which is neither too hot nor too cold . This climatic condition of Chitlang makes the place quiet favourable for human settlement and agricultural activities.


Local people of Chitlangvillage cultivates varioustypes of agricultural crops such as wheat , paddy , maize etc.

Like agricultur animal rearing is also one of the main economic activities of  Chitlang and its local residents . Among all the animals goat raering is more famous and in practise in Chitlang.

Local people earn their living by selling agricultural goods,gats,goats milk,cheese produced through the  milk of goat etc.This has helped a lot to improve the economic condition of the local people Chitlang and Chitlang itself.

The maik production of this place is Cheese from the milk of goat which is resred by the people living in Chitlang.

Chitlang village is also a religiously famous place . The famous temple named "Shivalaya" is also located over here.This temple has three pinnacle in its top which makes the temple unique.

Chitlang is a naturally beautiful place .The decidious and coniferous forest found over here enhances the natural beauty of the place .Chitlang is indeed situated between two dense forest s from sides which creates a magical and fresh environment all around the place.
Orchid,a very attractive and rare kind of flower is also found over here . These flowers enhances the beauty of the village.

High an dtall yet adorable trees of pine and sals makes the place look evan more natural and fresh.

Not only forests,trees and orchids makesthe place look beautiful but also some snow peaked mountains enhances the natural beauty of Chitlang.

"Chandragirin" is one of those beautiful mountains contributing a lot for the heart touching beautiful environment of Chitlang vilage.

Furthermore,the future projects of Chitlang village is the construction of a ropeway transportation through the "Chandragirin" which is in the process of construction at preaent.

The success of this project or construction can contribute a lot for transportational development of chitlang.

Water mill is also another attraction in Chitlang where grinding is done with the help of water.

"Chandragirin",the famous mountain of Chitlangis named so because of itsunique shape as a moon (Chandra in nepali).

The soil of  Chitlang is very fertile which makes it suitable for the agriculture and production of agricultural goods , herbs, and crops.


Tuesday, November 19, 2013

1.WAP A PROGRAM TO REVERSE THE DIGITS.

REM
CLS


S=0
INPUT "ENTER ANY NUMBER";N
       WHILE N<>0
       R=N MOD 10
     S=S*10+R
     N=N\10
      WEND
                      PRINT"THE REVERSE NUMBER=";S
       END








2.WAP TO DISPLAY THE PRODUCT OF ENTERED DIGITS.






REM
CLS
   S=0
              INPUT" ENTER ANY NUMBER";N
             WHILE N<>0
               R=N MOD 10
           S=S*R
              N=N\10
              WEND
                  PRINT"PRODUCT OF DIGITS=";S
                END





3.WAP TO DISPLAY THE PRODUCT OF EVEN DIGITS.



REM
CLS
 S=0
    INPUT" ENTER ANY NUMBER";N
       WHILE N<>0
     R=N MOD 10
    IF R MOD 2=0 THEN S=S*R
 N=N\10
    WEND
        PRINT"PRODUCT OF EVEN DIGITS=";S
     END






4.WAP TO DISPLAY THE PRODUCT OF ODD DIGITS.

        REM
       CLS
        S=0
           INPUT" ENTER ANY NUMBER";N
              WHILE N<>0
              R=N MOD 10
             IF R MOD 2=1 THEN S=S*R
                N=N\10
                WEND
                             PRINT"PRODUCTOF ODD DIGITS=";S
                  END




5.WAP TO COUNT TOTAL NUMBER OF ENTERED NUMBER.

REM
CLS
                       INPUT" ENTER ANY NUMBER";N
                WHILE N<>0
                R=NMOD10
                S=S+1
                  N=N\10
                  WEND
                                 PRINT"TOTAL NUMBER OF  DIGITS=";S
                    END








6. WAP TO COUNT TOTAL NUMBER OF EVEN NUMBER.
               
 REM
  CLS
                          INPUT" ENTER ANY NUMBER";N
                      WHILE N<>0
                      R=N MOD 10
                       IF R  MOD 2=0 THEN S=S+1
                        N=N\10
                        WEND
                       PRINT"TOTAL NUMBER OF EVEN  DIGITS=";S
                         END





7. WAP TO COUNT TOTAL NUMBER OF EVEN NUMBERS.


REM
CLS
           INPUT" ENTER ANY NUMBER";N
       WHILE N<>0
      R=N  MOD 10
          IF R MOD 2=1 THEN S=S+1
        N=N\10
       WEND
                      PRINT"TOTAL NUMBER OF ODD  DIGITS=";S
         END






8. WAP TO CHECK WHETHER THE GIVEN NUMBER IS ARMSTRONG OR NOT.



REM
CLS
INPUT"ENTER ANY NUMBER";N
       V=N
         WHILE V<>0
         R=V MOD 10
           S=S+R^3
          V=INT(V/10)
           WEND
           IF N=S THEN
                   PRINT N;"IS  ARMSTRONG NUMBER"
           ELSE
                          PRINT N;"IS NOT ARMSTRONG NUMBER"
            ENDIF
            END




9. WAP TO CHECK WHETHER THE GIVEN NUMBER IS PALINDROME OR NOT.



REM
CLS
INPUT"ENTER ANY NUMBER";N
     A=N
       WHILE N<>0
         R=N MOD 10
         S=S*10+R
         N=N\10
         WEND
         IF A=S THEN
                      PRINT A;"IS  PALINDROME NUMBER"
            ELSE
                         PRINT A ;"IS NOT PALINDROME NUMBER "
             ENDIF


              END