Computer Science, asked by ashxrafi, 3 months ago

Write a program in QBASIC to enter a number and check whether the number is prime or not




PLS I NEED TO SUBMIT MY WORKSHEET I DINT KNOW THIS ANSWER ​

Answers

Answered by singhbasant43668
0

Answer:

bxudhfbd dbdkdkdbdls

zjsidldkdishheowpwm

hsjsksbfuejwpqpkd

sjsjdkrojrowlahuele

jskeppejhsuwknjjeiowlw

jskekrjjdipqllbshienrhjsjsjje

jsjdjrbwllsbhdkwnusoebyale

hsjsklenahjrbdghrbdl

hdjrjrldojsgailrldjenidkelwje

hsjejbridbcyhsjxtfshkelqken

hsjehehikbagiwlrbsilamdjsp

Answered by dreamrob
0

Program:

Dim n As Integer

Dim i As Integer

Dim flag As Integer

Cls

Input "Enter a number : ", n

flag = 0

For i = 2 To n - 1

   If n Mod i = 0 Then

       flag = 1

   End If

Next i

If flag = 0 Then

   Print "Prime number"

Else

   Print "Not a prime number"

End If

End

Output 1:

Enter a number : 101

Prime number

Output 2:

Enter a number : 34

Not a prime number

Similar questions