P
Pixie
I was asked by professor to figure out the mistakes and fill in the
functions for this program. I cannot figure it out and I hope someone
can help me.Any input would be helpful. Thanks, PIXIE
here is the program:
// digits.cpp
#include <iostream>
using std::cout;
using std::cin;
using std::endl;
int main()
{
int num;
cout << "Enter a five-digit number: ";
cin >> num;
/* write a statement to print the left-most digit of 5-digit number
*/
/* write a statement that changes num from a 5-digits to 4-digits
*/
/* write a statement to print the left-most digit of 4-digit number
*/
/* write a statement that changes num from a 4-digits to 3-digits
*/
/* write a statement to print the left-most digit of 3-digit number
*/
/* write a statement that changes num from a 3-digits to 2-digits
*/
/* write a statement to print the left-most digit of 2-digit number
*/
/* write a statement that changes num from a 2-digits to 1-digit
*/
cout << num << endl;
return 0;
}
functions for this program. I cannot figure it out and I hope someone
can help me.Any input would be helpful. Thanks, PIXIE
here is the program:
// digits.cpp
#include <iostream>
using std::cout;
using std::cin;
using std::endl;
int main()
{
int num;
cout << "Enter a five-digit number: ";
cin >> num;
/* write a statement to print the left-most digit of 5-digit number
*/
/* write a statement that changes num from a 5-digits to 4-digits
*/
/* write a statement to print the left-most digit of 4-digit number
*/
/* write a statement that changes num from a 4-digits to 3-digits
*/
/* write a statement to print the left-most digit of 3-digit number
*/
/* write a statement that changes num from a 3-digits to 2-digits
*/
/* write a statement to print the left-most digit of 2-digit number
*/
/* write a statement that changes num from a 2-digits to 1-digit
*/
cout << num << endl;
return 0;
}