ASCII I Want To change Size Of Symbol Like "a" To Get "A"

#include <iostream>
using namespace std;

int main()
{

char c;
cout << " Chaweret Sibmbolo : ";
cin >> c;
cout << " ASCII Mnishvneloba : " << c << " Aris " << int(c) << endl;
system("pause");

}
Last edited on
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#include <iostream>
#include <locale>

int main()
{
    char c ;
    std::cout << "enter a character: " ;
    std::cin >> c ;

    const int v = c ;
    std::cout << "character: " << c << " int value: " << v << '\n' ;

    // get the locale used for input by std::cin
    // https://en.cppreference.com/w/cpp/io/ios_base/getloc
    const std::locale input_locale = std::cin.getloc() ;

    // uncomment the imbue line if std::cout is set to use a different locale
    // (this not necessary here; by default std::cin and std::cout would use the same locale)
    // std::cout.imbue(input_locale) ;

    // if it is an upper case character in the input locale
    // https://en.cppreference.com/w/cpp/locale/isupper
    if( std::isupper( c, input_locale ) )
    {
        // print out the corresponding lower case character
        // https://en.cppreference.com/w/cpp/locale/tolower
        std::cout << "the lower case character is: " << std::tolower( c, input_locale ) << '\n' ;
    }

    // if it is a lower case character in the input locale
    // https://en.cppreference.com/w/cpp/locale/islower
    else if( std::islower( c, input_locale ) )
    {
        // print out the corresponding upper case character
        // https://en.cppreference.com/w/cpp/locale/toupper
        std::cout << "the upper case character is: " << std::toupper( c, input_locale ) << '\n' ;
    }
}
Topic archived. No new replies allowed.