how to generate code to get output-
input-12345
output-1+2+3+4+5=15

You're going to have to show a little more effort to get any help, nobody is going to do your homework for you. What have you got for code so far? Have you planned it out in pseudo code yet? For example:

prompt user for input
separate numbers
add them together
display result

That pretty much spells out the steps, now all you have to is translate that to code. Write come code, and if you have any problems, post the code for guidance.

Good Luck

Open a text editor, type code, save, exit the editor, open a command shell, cd to where you saved the code (with a .java extension and the same name as the public class contained) use javac to compile, and java (or javaw) to execute.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.