write a compile and run a c++ program to reverse the digits of a positive integer number .use a do-while statement and continuously strip off and display the numbers units digit
#include <iostream>
#include <cstdlib>
#include <ctime>
constchar* desc[] =
{ "sexy", "curvaceous", "monstrous", "huge", "misshapen", "odd", "engorged" } ;
const std::size_t desc_size = sizeof(desc) / sizeof(desc[0]) ;
void strip( unsigned& num )
{
unsigned digit = num % 10 ;
std::cout << num << " strips, exposing its "
<< desc[rand()%desc_size] << " digit: " << digit << '\n' ;
num /= 10 ;
}
int main()
{
std::cout << "enter a number: " ;
unsigned n ;
std::cin >> n ;
while ( n )
strip(n) ;
std::cout << "Behold, " << n << " in all its naked glory!\n" ;
}
[edit: Also, don't make duplicate posts. Posting something 3 times is more likely to get you ignored than it is to get you a response. Please read: http://www.cplusplus.com/forum/general/98395/
Particularly the part about titling posts. "help" is not helpful.]