i need help with a program i am writing a in c++ and Java .a program that when i input a figure like 2345 it will sum the figure up by adding 2+3+4+5 can any one help some one give me some code int a = 0 int i = atoi(argv[1]); while (i) { a += i%10; i /= 10; } printf("%d\n", a); but it does not run.
atoivan
0
Newbie Poster
Recommended Answers
Jump to PostApparently someone has already done part of your homework for you.
This list doesn't usually do people's homework for them. Why not ask the person who did the first part to do the rest of it?
All 2 Replies
Reply to this topic
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.