-->
Showing posts with label sub procedure. Show all posts
Showing posts with label sub procedure. Show all posts

Wednesday, July 23, 2025

Qbasic program to find area of rectangle and circle using sub and function procedure | SEE computer science datafile program

 

QBasic programs collection-Especially for SEE (Grade-10)

QBasic procedure based programming  questions asked in Triton's model questions

QBasic programs [Triton's model set-I]

declare sub area_rectangle(l,b)

declare function area_circle(r)

Input "enter length and breadth of rectangle"; l, b

Input "enter radius of circle"; r

Call area_rectangle(l, b)

Print "the area of circle is"; area_circle(r)

End

Sub area_rectangle (l, b)

    area = l * b

    Print "the area is"; area

End Sub


Function area_circle (r)

    area_circle = 3.14 * r ^ 2

End Function




Monday, July 14, 2025

SEE Computer Science: sub procedure program – QBASIC Sub Procedure Program Explained-2081 BS

 

QBASIC programs collection

Sub  procedure program [Triton model question-2081 set V q5]

DECLARE SUB SENDUP (S$)

E$ = "NPABSON"

Call SENDUP(E$)

End

Sub SENDUP (S$)

    For i = 1 To Len(S$) Step 1

        If i Mod 2 <> 0 Then

            EE$ = EE$ + LCase$(Mid$(S$, i, 1))

        Else

            EE$ = EE$ + UCase$(Mid$(S$, i, 1))

        End If

    Next i

    Print EE$

End Sub


SEE Computer Science: sub procedure program – QBASIC Sub Procedure Program Explained-2079 BS

 

QBASIC programs collection- 2079 B.S. GP

Sub and function procedure program [Triton model question]


'rem q9 A 2079 GP

declare sub perimeter(l,b)

declare function area(l,b)

Cls

Input "enter length and breadth"; l, b

Call perimeter(l, b)

Print "the area is"; area(l, b)

End

Sub perimeter (l, b)

    p = 2 * (l + b)

    Print "the perimeter is"; p

End Sub

Function area (l, b)

    area = l * b

End Function


Sunday, June 15, 2025

Qbasic program to know the output using dry run table | SEE computer science programming guide in Qbasic -to know the greater number

 

QBasic programs collection-Especially for SEE (Grade-10)



QBasic program to know the output of program using dry run table- to find the greater number, using sub procedure


declare sub pabson(A,b)

Cls

x = 15

y = 10

Call pabson(x, y)

Call pabson(3, 6)

End

Sub pabson (a, b)

    If a < b Then

        Print a

    Else

        Print b

    End If

End Sub








Tuesday, June 10, 2025

Qbasic program to get output using dry run table | SEE computer science programming guide in Qbasic -to find sum of numbers divisible by 4

 

QBasic programs collection-Especially for SEE (Grade-10)



QBasic program to know the output of program using dry run table- to find the sum of numbers between 1 and 20 and which are divisible by 4, using sub procedure



declare sub sum(A)

A = 2

Call sum(A)

End

Sub sum (A)

    While A <= 20

        If A Mod 4 = 0 Then

            s = s + A

        End If

        A = A + 1

    Wend

    Print s

End Sub

Dry run table

A

While A<=20

        If A Mod 4 = 0

S=s+A

A=A+1

2

yes

no

 

A=3

3

yes

no

 

A=4

4

yes

yes

S=s+A=0+4=4

A=5

5

yes

no

 

A=6

6

yes

no

 

A=7

7

yes

no

 

A=8

8

y

yes

S=4+8=12

A=9

9

yes

n

 

=10

10

yes

n

 

=11

11

yes

N

 

=12

12

yes

y

=12+12=24

A=13

13

yes

n

 

=14

14

yes

n

 

=15

15

yes

n

 

=16

16

yes

y

=24+16=40

=17

17

yes

n

 

=18

18

yes

n

 

=19

19

yes

n

 

=20

20

yes

y

=40+20=60

21

21

no

 

 

 


output:60