Full width home advertisement

Grade 10 Revision

Post Page Advertisement [Top]

Possible QBASIC Modular Programming for SEE

Here are some of the QBASIC Modular Prgramming Questions and their soultions which are frequently asked in SEE/SLC.

1. WAP to check whether the given number is even or odd using SUB.. END..SUB.
Ans.
DECLARE SUB CHECK(N)
INPUT"ENTER ANY NUMBER";N
CALL CHECK(A)
END
SUB CHECK(A)
IF N MOD 2 = 0 THEN
PRINT "EVEN"
ELSE
PRINT "ODD"
END IF
END SUB

2.WAP to check whether the given number is even or odd using FUNCTION.. END..FUNCTION.
Ans.
DECLARE FUNCTION CHECK$ (N)
CLS
INPUT “ENTER ANY NUMBER”; N
PRINT N; “IS “; CHECK$(N)
END
FUNCTION CHECK$ (N)
IF N MOD 2 = 0 THEN
CHECK$ = “EVEN NUMBER”
ELSE
CHECK$ = “ODD NUMBER”
END IF
END FUNCTION


3. WAP to find the area of circle using SUB...END..SUB
Ans.
DECLARE SUB AREA(R)
INPUT"ENTER RADIUS";R
CALL AREA(R)
END
SUB AREA(R)
A= 3.14* R^2
PRINT "THE AREA OF CIRCLE IS";A
END SUB


4.WAP to find area of circle using FUNCTION....END....FUNCTION
Ans.
DECLARE FUNCTION AREA(R)
CLS
INPUT “ENTER RADIUS”; R
PRINT “THE AREA IS "; AREA(R)
END
FUNCTION AREA(R)
A=3.14*R^2
AREA= A
END FUNCTION


5. WAP to find the sum of individual digits of a multidigit number using SUB...END...SUB
Ans.
DECLARE SUB SUM (N)
CLS
INPUT "ENTER ANY NUMBER"; N
CALL SUM (N)
END

SUB SUM (N)
S = 0
WHILE N < > 0
R = N MOD 10
S = S + R
N = N \ 10
WEND
PRINT "SUM OF DIGITS"; S
END SUB



6. WAP to find the sum of individual digits of a multidigit number using FUNCTION...END...FUNCTION
Ans.
DECLARE FUNCTION SUM (N)
CLS
INPUT "ENTER ANY NUMBER"; N
SU = SUM (N)
PRINT "SUM OF DIGITS"; SU
END

FUNCTION SUM (N)
S = 0
WHILE N < > 0
R = N MOD 10
S = S + R
N = N \ 10
WEND
SUM = S
END FUNCTION


1 comment:

  1. Hi All!

    We are selling fresh & genuine SSN Leads, with good connectivity. All data is tested & verified.
    Headers in Leads:

    First Name | Last Name | SSN | Dob | Address | State | City | Zip | Phone Number | Account Number | Bank Name | DL Number | Routing Number | IP Address | Reference | Email | Rental/Owner |

    *You can ask for sample before any deal
    *Each lead will be cost $1
    *Premium Lead will be cost $5
    *If anyone wants in bulk I will negotiate
    *Sampling is just for serious buyers

    Hope for the long term deal
    For detailed information please contact me on:

    Whatsapp > +923172721122
    email > leads.sellers1212@gmail.com
    telegram > @leadsupplier
    ICQ > 752822040

    ReplyDelete

Bottom Ad [Post Page]