ADS. Computer Science-III PU Practical Solution Group-7 2019

University of the Punjab

BA/BSc.  Part I Computer Science Practical

Group 7 – Annual-2019 Solution

Download Original Papers From:

https://educationhub.pk/pu-ba-bsc-practical-papers-third-year/

Question No 01:

1.      ——————————————————————–

Question No 02:

Program:

 

Private Sub Command1_click()

Dim num As Integer , isPrime As Boolean = False

num = InputBox(“Enter a Number”, “Input” , 0)

            For I = 2 to sqrt(num)

            If num Mod I = 0 Then

                        isPrime = True

                        Exit For

            End If

            Next

            If isPrime = True Then

Print “Number is Prime”

Else

Print(“Number is Composite.”

End If

 

End Sub