In this tutorial, we will use Python 3 programming language to solve the problem given above. If you also know any programming language out of the programming languages given in the problem, then you can also solve this problem by using that programming language.
So let's... solve this problem using Python 3 programming language...
Program 1: Simple Python Program
# Date: Sunday, 29-11-2020
# @author: Ankur Saxena
# Platform: Linux Ubuntu 18.04 Lts/x64/Python 3.8/Visual Studio Code
# Program Start
num1 = 900
num2 = 1000
for num in range(num1, num2 + 1):
# all prime numbers are greater than 1
if num > 1:
for i in range(2, num):
if (num % i) == 0:
break
else:
print(num)
# Program End
# Save this file as "FindPrimeNo.py"
# Execute: $ python3 FindPrimeNo.py [press the Enter key]
Program 2: Python Program To Print All The Prime Numbers
# Date: Sunday, 29-11-2020
# @author: Ankur Saxena
# Platform: Linux Ubuntu 18.04 Lts/x64/Python 3.8/Visual Studio Code
# Program Start
# take the input from the user
num1 = int (input("Please enter first number : "))
num2 = int (input("Please enter second number : "))
# Execute: $ python3 FindPrimeNo1.py [press the Enter key]
So friends! In today's tutorial, that's all... see you soon with a new tutorial/article. Till then stay safe, stay healthy, be happy and keep studying...
0 Comments