Find Sum of Digits of a Number – Java Code

Write a java program to find sum of digits of a number. Given an input number, we have to write a java code to calculate sum of digits of a number.

For example –

i)

Input : 256

Output : 13 (2+5+60

ii)

Input : 15

Output : 6 (1+5)

MCQ on Data Structure – Stack and Queue

MCQ on stack and queue data structure. The concept of Stack and Queue data structure is very important in computer science. In my previous post i have discussed following things.

Subscribe Our Tutorials

Get Latest Updates on Facebook

Stack program in C using Array.

Queue data structure and their implementation.

The purpose of this objective questions is to test how well you understand the concept of stack and queue.