← All problemsSign in

Sum Of Digits

You are being given a number N . (1<=N<=1000). You have to print the sum of digits of that particular number. Input : The first line will contain T , the number of testcases ( T<10) . The next T lines will contain the numbers whose sum of digits you have to calculate. Output : Output T lines containing the Sum of Digits of the numbers. Example : Input: 3 123 72 1000 Output : 6 9 1

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.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start