Escolar Documentos
Profissional Documentos
Cultura Documentos
CLS
Input "Enter the weight in kilogram "; K
Let P=K*2.2
Print "The pound is "; P
End
End
Cls
Input" Enter any number" ;N
Let T=10/100*N
Let Twe=20/100*N
Let Thi=30/100*N
Print " 10%of input number=" ;T
Print " 20%of input number=" ;Twe
Print " 30%of input number=" ;Thi
End
Computers Laboratory / 1st Stage qbasic programs Thi-Qar University- EEE.Dept / Evening Study
Ex4: Write a program to enter any two numbers their Sum,Product
and the Difference.
CLS
Input " Enter any number" ;A
Input " Enter any number" ;B
Let Sum = A+B
Let Difference= A-B
Let Product = A*B
Print" the sum =" ;Sum
Print" the Difference =" ;Difference
Print" the Product =" ; Product
End
Ex5: Find the maximum and the minimum number between three
numbers.
CLS
INPUT "Please input the 1st number= ", a
INPUT "Please input the 2nd number= ", b
INPUT "Please input the 3rd number= ", c
Max=a
IF b > max THEN max= b
IF c > max THEN max= c
PRINT "The largest number is= "; max
Min= a
IF b < min THEN min = b
IF c < min THEN min = c
PRINT "The Smallest number is = "; min
END
EX6: program for determining the total & average for three
numbers:
CLS
Computers Laboratory / 1st Stage qbasic programs Thi-Qar University- EEE.Dept / Evening Study
REM This program will determine average for 3 numbers
INPUT "Please enter 1st number = ", a
INPUT "Please enter 2nd number = ", b
INPUT "Please enter 3rd number = ", c
t = a+b+c
s =T / 3
PRINT "The Total is = "; t
PRINT "The average is = ";s
END
Cls
Input" Enter the name " ;N$
Input" Enter the marks in English" ;E
Input" Enter the marks in Maths" ;M
Input" Enter the marks in Science" ;S
Input" Enter the marks in Nepali" ;N
Let S=E+M+S+N
Let A=S/4
Print " The name of the student is" ;N$
Print " The total marks is" ;S
Print " The Average marks" ;A
End
Ex10: Write a program to enter any number and find out whether it
is negative or positive.
CLS
Input Enter the number; N
If N>0 Then
Print The number is positive
Else
Print The number is negative
End If
End
CLS
REM "Determining the grade point basis on Subject mark"
INPUT "Enter the subject mark = ", n
IF n >= 95 THEN
PRINT "The grade point = A+"
END IF
IF n >=90 THEN
END IF
END