Question DSA-MATH-0004
EasyWhat is the output of this code?
print(17 % 5)
- A.
0
- B.
2
- C.
Show answer and explanation
Answer: B
% gives the remainder: 17 = 3 × 5 + 2, so 17 % 5 is 2.
Popular companies
Prepare company by company
Hiring pattern, syllabus, past questions and mocks for each company.
All companiesPractice by subject
Math and Number Theory question
What is the output of this code?
print(17 % 5)
0
2
Answer: B
% gives the remainder: 17 = 3 × 5 + 2, so 17 % 5 is 2.
1
3