cs/Practical File/questions/question_12_output.txt
Neil Revin 780baf678e
chore: move question & output files
Move python question files to 'questions' directory
Move output files to 'outputs' directory
Copy output files to 'questions' for ease of viewing

Signed-off-by: Neil <neil@willofsteel.me>
2025-06-24 02:34:07 +05:30

23 lines
533 B
Plaintext

Question 12:
Write a Python program to check whether a number is divisible by both 5 and 11.
Answer:
def main(num: int) -> None:
if num % 5 == 0 and num % 11 == 0:
print(f"{num} is divisible by both 5 and 11.")
else:
print(f"{num} is not divisible by both 5 and 11.")
if __name__ == '__main__':
main(55)
main(22)
main(10)
main(121)
Output:
55 is divisible by both 5 and 11.
22 is not divisible by both 5 and 11.
10 is not divisible by both 5 and 11.
121 is not divisible by both 5 and 11.