Skip to main content

QBASIC Solutions


Q.1) WAP to change degree Celsius into degree Fahrenheit.

 => CLS

       INPUT "Enter degree celsius value" ; D

       F = ( 9 * C / 5 ) + 32

       PRINT "Degree Fahrenheit value = "; F

       END

Q.2) WAP to change dollar into Nepali currency.
 => CLS
      INPUT "Enter Dollar value"; USD
       NRS = USD * 100
      PRINT "Nepali currency value = "; NRS
      END

Q.3) WAP to change Indian currency into Nepali currency.
=> CLS           
      INPUT "Enter Indian currency value"; IC
      NRS = IC * 1.6
      PRINT "Nepali currency value = "; NRS
      END

Q.4) WAP to convert paisa into rupee and paisa.
= > CLS

     INPUT "Enter paisa";P

     R=P MOD 100

     Paise = R *100

     PRINT "Rupee=";R

     PRINT "Paise=";Paise

     END


 Q.5) WAP to change minutes into hours and minutes.
=> CLS
      INPUT "Enter total minutes"; M
       H = M \ 60
       MIN = M MOD 60
       PRINT "Total hours = " ; H
       PRINT "Remaining minutes = "; M
       END

 Q.6) WAP to find the area of rectangle
 => CLS
      INPUT "Enter length" ; L
       INPUT "Enter breadth" ; B
       A = L * B
       PRINT "Area of rectangle = "; A
       END

 Q.7) WAP to find the area of square.
 => CLS
       INPUT "Enter length"; L
       A = L ^ 2
       PRINT "Area of square = "; A
       END

 Q.8) WAP to find the area of circle.
 => CLS
        INPUT "Enter radius"; R
       A = 22/7 * R ^2
       PRINT "Area of circle = "; A
       END

 Q.9) 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

 Q.10) WAP to find the area of parallelogram.
 => CLS
        INPUT "Enter base"; B
       INPUT "Enter height"; H
       A = B * H
       PRINT "Area of parallelogram "; A
       END

  Q.11) WAP to check whether the number is divisible by 3 and 7 or not.
 => CLS
       INPUT "Enter any number"; A
       R1 = A MOD 3
       R2 = A MOD 7
       IF R1 = 0 AND R2 = 0 THEN
       PRINT "Number is divisible by 3 and 7"
       ELSE
       PRINT "Number is not divisible by 3 and 7"
       END IF
       END

 Q.12)  WAP to check whether the given number is positive/ negative/ zero.
 => CLS
       INPUT "Enter any number"; A
       IF A >0 THEN
       PRINT "Number is positive"
       ELSEIF A <0 THEN
       PRINT "Number is negative"
       ELSE
       PRINT "Number is zero"
       END IF
       END

 Q.13) WAP to check whether the number is odd or even.
 => CLS
       INPUT "Enter any number" ; A
       R = A MOD 2
       IF R = 1 THEN
       PRINT "Number is odd"
       ELSE
       PRINT "Number is even"
       END IF
       END

 Q.14) WAP to enter any 3 numbers and find the smallest one.
 => CLS
       INPUT "Enter any three numbers" ; A, B, C
       IF A< B AND A< C THEN
       PRINT A ; " is the smallest number."
       ELSEIF B<A AND B<C THEN
       PRINT B ; " is the smallest number."
       ELSEIF C<A AND C<B THEN
       PRINT C ; " is the smallest number."
       ELSE
       PRINT "All the numbers are equal."
       END IF
       END

 Q.15) WAP to enter name and percentage and print the name, percentage and the division passed in.
 => CLS
       INPUT "Enter name"; N$
       INPUT "Enter percentage"; P
       IF P>= 80 AND P<=100 THEN
       D$ = "Distinction"
       ELSEIF P>= 60 AND P<=69.9 THEN
       D$ = "First Division"
       ELSEIF P>=50 AND P<= 59.9 THEN
       D$ = "Second Division"
       ELSEIF P>=40 AND P<=49.9 THEN
       D$ = "Third Division"
       ELSEIF P<40 THEN
       D$ = "Failed"
       ELSE
       D$ = "Wrong Entry"
       END IF
      END



Comments

Popular posts from this blog

17 QBASIC Programming

1. Create a sequential file "std.dat" to store name and marks obtained in English, Math and Science subjects for a few students. (74 set 1) OPEN   “std.dat”   FOR OUTPUT   AS   #1 DO CLS INPUT “Enter name “; N$ INPUT   “Enter English marks”; E INPUT “Enter Math's marks"; M INPUT "Enter Science marks"; S WRITE #1, N$, E, M, S INPUT "Do you want to continue (Y/N)";CH$ LOOP WHILE UCASE$ (CH$) "Y" CLOSE #1 END 4.   WAP to add some more   records in a data file “ABC.DAT” having following fields : patient’s name, address and age.  OPEN   “ABC.DAT”   FOR OUTPUT   AS   #1 DO CLS INPUT “Enter Patients name “; N$ INPUT   “Enter patients address”; A$ INPUT “Enter Patient's age "; A WRITE #1, N$, A$, A INPUT "Do you want to continue (Y/N)";CH$ LOOP WHILE CH$="Y" OR CH$="y" CLOSE #1 END       6.WAP to store records regarding the information of book’s number, name and author’s ...

dashain

                                        Dashain What is mean by Dashain? During the month of Kartik (late September and early October), the Nepalese people indulge in the biggest festival of the year, Dashain. Dashain is the longest and the most auspicious festival in the Nepalese annual calendar, celebrated by Nepalese of all caste and creed throughout the country. The fifteen days of celebration occurs during the bright lunar fortnight ending on the day of the full moon. Thorough out the kingdom of Nepal the goddess Durga in all her manifestations are worshiped with innumerable pujas, abundant offerings and thousands of animal sacrifices for the ritual holy bathing, thus drenching the goddess for days in blood.