hi guys I am having a bit of trouble with chars my problem is as follows:

c. (No prompts or explanatory text necessary.) The user types a 3-digit number which you input as 3 separate chars. You then compute the number that represents and output it as a single value. A sample run of your program might go as
540
540
The first line represents 3 char inputs that you do, and the second line represents one unsigned (or int) output that you do.

d. Same as c, except this time you do a single input of an unsigned (or int) and three char outputs. An example run of your program might go as
540
540

e. (Still no prompts or explanatory text necessary.) The input (you may assume without checking) is 2 chars: an upper case letter followed by a lower case letter. The output is the letters in reverse order, but the first letter output is to be uppercase and the second letter output is to be upper case. A sample run of your program might go as
Au
Ua


This is my code so far note my professor wanted us to do all 9 programs in 1 .cpp file thus the obnoxious large code.





Code:
//  CS 575 HW 3 


#include <iostream>
#include <string>
using namespace std;


void a();
void b();
void c();
void d();
void e();
void f();
void g();
void h();


bool die( const string & msg );


int main(){


/*
    unsigned n;
    cout <<"Gimme a # in [13,19]: ";
    cin >>n;
    if( !cin )  die( "C'mon, man, that's not even a number!" );
    if( n < 13 )  die( "too small" );
    if( n > 19 )  die( "too large" );


    cout <<"Thanks for the " <<n <<endl;
    cout <<"Thanks for using this amazing program" <<endl;
*/
    a();
    b();
    c();
    d();
    e();
    f();
    g();
    h();


}


void a(){
    unsigned dollars, quarters, dimes, nickels, pennies;
    cin >>dollars >>quarters >>dimes >>nickels >>pennies;
    cout <<100*dollars+25*quarters+10*dimes+5*nickels+pennies <<endl;
}    //  a


void b(){
    unsigned n;
    cin >>n;
    if( !cin )  die( "non-numeric input" );
    if( n < 10000 ) die( "too small" );
    if( n > 99999 ) die( "too large" );
    cout <<n/100 <<endl;
}    //  b


void c(){
    char n[3];
    cin >>n;
    cout<< n << endl;
}    //  c


void d(){
}    //  d


void e(){
}    //  e


void f(){
    string phoneNo;
    cin >>phoneNo;
    if( phoneNo.size() == 13                   &&
        phoneNo[0] == '('                      &&
        '2' <= phoneNo[1] && phoneNo[1] <= '9' &&
        '0' <= phoneNo[2] && phoneNo[2] <= '9' &&
        phoneNo[8] == '-' )
        cout <<"ok" <<endl;
    else
        cout <<"bogus" <<endl;
}    //  f


void g(){
    unsigned c0, c1;
    cin >>c0 >>c1;
    if( !cin )  die( "non-numeric input" );
    if( c0 < 1 || c0 > 13 || c1 < 1 || c1 > 13 )  die( "out of range" );
    if( c0 == c1 )
        cout <<"pair" <<endl;
    else
        cout <<"nothing" <<endl;
}    //  g


void h(){
}    //  h




bool die( const string & msg ){
    cerr <<endl <<"Fatal error: " <<msg <<endl;
    exit( EXIT_FAILURE );
}   //  d
in problem in c I am stuck the compiler sends me an error e #2 stack around the variable "n" was corrupted. do i need if and elste statements? I was thinking of char to int conversion but its too confusing as I am still amateur.

Please understand I am still beginner thus your wisdom shall save me from my igorance. I will keep updating as I find solutions to my homework maybe it helps others as well.

Thanks for your time.