I made my program to reverse digits of a four digit integer value entered by the user. Here is the code:
I think the code is okeys but the compiler gives me the following message when i press F9.Code:#include<iostream> #include<conio.h> using std::cout; using std::cin; using std::endl; void reverse(int) // function prototype int main() { int num; // declare varible cout<< "Enter any 4 digit integer:"; // prompt the user for input cin>> num; // read input reverse(num); // display reverse order getch(); } void reverse(int value) // definition { int digit1, digit2, digit3, digit4; // declare alias digit1=value%10; // separate digit1 value/=10; // divide the remaining 3 digit number digit2=value%10; // separate digit2 value/=10; // divide the remaining 2 digit number digit3=value%10; // separate digit3 value/=10; // separate the last remaining digit digit4=value%10; // separate digit4 cout<< digit4 << digit3 << digit2 << digit1; // reverse order }
'unable to run the program'
Is there anything wrong with the compiler? Do I have to reinstall it?