Looking for Batch-01_BSc_Semester-01_Algorithmic Thinking and its Applications test answers and solutions? Browse our comprehensive collection of verified answers for Batch-01_BSc_Semester-01_Algorithmic Thinking and its Applications at iitjbsc.futurense.com.
Get instant access to accurate answers and detailed explanations for your course questions. Our community-driven platform helps students succeed!
What is the output of the following code for input 10203?
Python Code
num = 10203
product = 1
while num > 0:
digit = num % 10
if digit != 0:
product *= digit
num //= 10
print(product)
What will be the output of the following code when the input is 24853?
Python Code
num = 24853
count = 0
while num > 0:
digit = num % 10
if digit % 2 == 0:
count += 1
num //= 10
print(count)
Which of the following algorithms correctly counts the number of digits in a given positive integer n in Python?