kiosk55
10-27-2005, 05:42 PM
This is for a C++ class
I have an assignment for school to input a 4 digit integer, but for each of the numbers that is entered I need to assign to a variable to do manuplation with each value.
I am thinking I need to use the cin.get() for my program, but now sure how to assign each value to a variable
For example:
Enter a 4 digit number: 4569 (only limit it to max of 4 values!)
Now assign the first digit (4) to a variable, the 2nd digit (5) to a variable and so on.
Thanks for the help!
I have an assignment for school to input a 4 digit integer, but for each of the numbers that is entered I need to assign to a variable to do manuplation with each value.
I am thinking I need to use the cin.get() for my program, but now sure how to assign each value to a variable
For example:
Enter a 4 digit number: 4569 (only limit it to max of 4 values!)
Now assign the first digit (4) to a variable, the 2nd digit (5) to a variable and so on.
Thanks for the help!