Advertisement Area

Program #13: To Convert Lowercase into Uppercase

C++ Language

#include<iostream.h>
#include<conio.h>
void main()
{   
    char change(char);
    char lower,upper;
    clrscr();
    cout<<"Enter a lowercase letter - ";
    cin>>lower;
    upper=change(lower);
    cout<<"The uppercase equivalent of "<<lower<<" is "<<upper;
    getch();
}
char change(char C)
{
    if(C >= 97 && C<=122)
    return(C-32);
}

/*OUTPUT*/
Enter a lowercase letter - d
The uppercase equivalent of d is D