Digit Sum
CodeChefOpen on judge ↗
You are given two numbers $N$ and $C$ and your task is to find the value of sum of digit of $N$ but the condition is as follows:- - If $C$=0 then calculate the sum of digit at even position - If $C$=1 then calculate the sum of digit at odd position $Note :-$ Indexing of the number is started as 0 i.e. if the number is 965 the position of digit 9 is 0, position of digit 6 is 1 and position of digi
HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17
CodeSearch Tutor
Hints, not spoilers — it won’t hand over the full solution unless you insist.
Sign in to chat with the tutor and save your progress.
Sign in to start