Monday, March 19, 2018

write a program by using QBASIC code to input name class and marks obtained in 3 subjects of any one student and calculate total, percentage and display them.


Write a program by using QBASIC code to input name class and marks obtained in 3 subjects of any one student and calculate total, percentage and display them.


CLS
INPUT “ENTER NAME”; N$
INPUT “ENTER CLASS”; C
INPUT “ENTER MARKS OBTAINED IN ANY THREE SUBJECTS”; A, B, C
T = A+ B+ C
P = T / 3
PRINT “YOUR NAME IS”;N$
PRINT “YOUR CLASS IS”; C
PRINT “YOUR OBTAINED MARKS ARE”; A, B, C
PRINT “TOTAL MARKS = “; T
PRINT “PERCENTAGE = “; P
END


Thursday, March 15, 2018

Qbasic Program to display the product of all numbers from 4 to 8 up to 10th terms.

Qbasic Program to display the product of all numbers from 4 to 8 up to 10th terms.

4 देखि 8 सम्म को टेबल लेख 10 टर्म सम्म 

CLS
FOR i = 4 TO 8
    FOR j = 1 TO 10
        PRINT i; "X"; j; "="; i * j
    NEXT j
    PRINT
NEXT i
END

Saturday, March 10, 2018

Qbasic Program that accepts any 12 names and displays the longest among them.

Qbasic Program  that accepts any 12 names and displays the longest among them.

CLS
DIM n(12) AS STRING
FOR i = 1 TO 12
    INPUT "enter 12 names"; n(i)
NEXT i
a$ = n(1)
FOR j = 2 TO 12
    IF LEN(n(j)) > LEN(a$) THEN a$ = n(j)
NEXT j
PRINT "The longest name is: "; a$



END