representation in array

S

silajana

How to write a c++ program to accept a number and show it with its
postion in an array? For example accet 123 and show it as a[0]=1,
a[1]=2 and a[2]=3 etc.
 
I

Ian Collins

How to write a c++ program to accept a number and show it with its
postion in an array? For example accet 123 and show it as a[0]=1,
a[1]=2 and a[2]=3 etc.
Read the number as a string or character array and display that.
 
M

Murali

How to write a c++ program to accept a number and show it with its
postion in an array? For example accet 123 and show it as a[0]=1,
a[1]=2 and a[2]=3 etc.
 
D

Default User

Murali said:
How to write a c++ program to accept a number and show it with its
postion in an array? For example accet 123 and show it as a[0]=1,
a[1]=2 and a[2]=3 etc.
Use the modulo operation , n%10 get the remainder.till the given
numebr become 0. Otherwise convert the given number into the
string using itoa().



Why did you put > characters in front of the lines you wrote? Are you
not aware that those typically indicate reply text?

Also, there's no such function as itoa() in C++.





Brian
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,301
Messages
2,571,549
Members
48,295
Latest member
JayKillian
Top