WAP to print all numbers between 50 and 100 which are not divisible by 3 and 5?
Answers
Answer:
Hope it will help you!!☺☺☺
The following codes have been written using Python.
We use a for loop, an iteration statement used to perform repeated-checking over a given range. In the loop, the range given is (50, 101), indicating that the traversing variable 'i', takes each value from 50 up to 100 and proceeds with the succeeding commands. The reason we give 101 instead of 100 is because the range function always excludes the last value. We use a conditional statement to check the divisibility of the number with 3 and 5. If they aren't divisible by both the numbers, they get printed, as per the question. In the conditional statement, we use a logical operator to ensure that both conditions, the divisibility by 3 and the divisibility by 5 are satisfied, and not just one out of the two.