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 –


Input : 256

Output : 13 (2+5+60


Input : 15

Output : 6 (1+5)

MCQ on Stack and Queue – Data Structure Practice Questions

MCQ on stack and queue data structure. A Stack and Queue data structure is very important in computer science. In this tutorial, you are going to learn about stack and queue data structure. Also you’ll find MCQ on stack and queues.

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.