calculating reveres and summation

can some one tell where is the error?

#include <iostream>
#include <string>
using namespace std;
void ReverseInputDigit (int I);
void SumDigit (int S);
int main ()
int I=0,S=0;
char f;
cout<<"please insert"<<endl;
cout<<"I for calculating Reverse Input Digit or S for calculating the summation of the digits"<<endl;
if(f == 'I')
ReverseInputDigit (I);
if(f == 'S')
SumDigit (S);
return 0;

void ReverseInputDigit (int I)
cout<<"Please insert a number to reverse: ";
cout<<"The reverse of "<<I<<" is " <<I % 10<<(I/10) % 10<<(I/100) % 10<<(I/1000) % 10<<(I/10000)% 10<<endl;//just 5 places!//
void SumDigit (int S)
cout<<"Please insert a any number "<<endl;
cout<<"The summation of "<<S<< " is "<< (S % 10)+((S/10) % 10)+((S/100) % 10)+((S/1000) % 10)+((S/10000)% 10)<<endl;//just 5 places!//
what seems to be an error? it works ok for 5-digit numbers.
Topic archived. No new replies allowed.