helooo am new to C++ hope i will find some help here :)
well the question is
if the i ask the user to input an integer like
int a;
cin>>a;
and if user inputs 2345
and the output i require is 2 3 4 5 how will i do that?
is there any header file required for it?
thanks

Recommended Answers

All 2 Replies

The only header file you will need is iostream. To accomplish your task you will need to isolate the individual digits as either single digit ints or as char and then display them one at a time with as much space between them as you wish.

And here's a tip to get you started: % /

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.