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
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.