The program prints all integers that aren%u2019t divisible by either 2 or 3 and lies between 1 and 50.
**
Problem Solution:**

1. Use a for-loop ranging from 0 to 51.
2. Then use an if statement to check if the number isn%u2019t divisible by both 2 and 3.
3. Print the numbers satisfying the condition.
4. Exit.
**
Python Program/Source Code:**

#Python Program to Print all Integers that Aren't Divisible by Either 2 or 3 and Lie between 1 and 50.
class divisibility:
def divide(self):
for i in range(1,51):
if i%2!=0 and i%3!=0:
print(i)
def main():
obj=divisibility()
obj.divide()
if __name__ == '__main__':
main()
**Program Explanation:**

1. The for loop ranges from 0 to 50 (as 51 isn%u2019t exclusive).
2. The expression within the if-statement checks if the remainder obtained when the number divided by 2 and 3 is one or not.
3. If the remainder isn%u2019t equal to 0, the number isn%u2019t divisible by either 2 and 3.
4. The number satisfying the condition is printed.
**Runtime Test Cases:**

1
5
7
11
13
17
19
23
25
29
31
35
37
41
43
47
49

## Comments