Horje
convert letters to uppercase in c++ Code Example
c++ char to uppercase
char choice; 
// it will instantly transform it to upper case without the need
// to convert it to int first
choice = (char)toupper(choice);
convert letters to uppercase in c++
#include <iostream>
#include <string>
using namespace std;

int main()
{
    char letter;

    cout << "You will be asked to enter a character.";
    cout << "\nIf it is a lowercase character, it will be converted to uppercase.";
    cout << "\n\nEnter a character. Press . to stop: ";

    cin >> letter;

    if(islower(letter))
    {
        letter = isupper(letter);
        cout << letter;
    }

    while(letter != '.')
    {
        cout << "\n\nEnter a character. Press . to stop: ";
        cin >> letter;

        if(islower(letter))
        {
            letter = toupper(letter);
            cout << letter;
        }
    }

    return 0;
}




Cpp

Related
c++ initialize a vector Code Example c++ initialize a vector Code Example
max two numbers c++ Code Example max two numbers c++ Code Example
stack implementation using class in c++ Code Example stack implementation using class in c++ Code Example
sort 2d vector c++ Code Example sort 2d vector c++ Code Example
position of max element in vector c++ Code Example position of max element in vector c++ Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
8