High = int(input("Enter the highest Value: ")) Low = int(input("Enter the lowest Value: ")) Python program to print prime number from 1 to 100 using nested for loop If it is true, it prints the number because it is a Prime Number. Next, the if statement checks whether the count is zero, and the given number is not equal to 1. If true, count incremented, and break statement skip that number. Second for loop will be used to check whether number is divisible or not and also Check for each number if it has any factor between 1 and itself. We will use first for loop to iterate between 1 to 100 values. In this program,we will use nested for loop to print prime number between 1 to 100. Python Program to print Prime Numbers from 1 to 100 using nested for loop We can use for loop ,while loop to print prime numbers.Ī prime number is a natural number which is greater than 1 and has no positive divisor other than 1 and itself, such as 2, 3, 5, 7, 11, 13, and so on. In this post, we are going to write python program to print prime numbers from 1 to 100.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |