How To Convert Uppercase To Lowercase In C++?

When we search for specific information, some articles do not find the information we need. But we hope you find the ideas you need in the How To Convert Uppercase To Lowercase In C++? article. Let’s go into the article.

The uppercase letter is the capital letter of the alphabet.

For example, capital letters are A, B, C, D, …, X, Y, Z. Similarly, a lowercase letter is represented by the small letter of the alphabet. For example, small letters are a, b, c, d, e…., w, x, y, z.

When converting uppercase letters or strings to lower case using ASCII codes, this process converts uppercase letters into lower case letters in C programming. The ASCII value of the uppercase (A -Z) is 65 to 90, and the ASCII lowercase (a -z) is 97 to 122.

How To Convert Uppercase To Lowercase In C++?

Convert Uppercase to Lowercase in C++

//C++ Program to convert uppercase to lowercase alphabet
#include <iostream>
using namespace std;
 
int main() {
    char c;
  
    cout << "Enter an uppercase alphabet\n";
    cin >> c;
  
    if(c >= 'A' && c <= 'Z'){
        // Add 32 to uppercase character to 
        // convert it to lowercase
        c += 32;
        cout << "Lowercase Alphabet : " << c;
    } else {
        cout << "Not an uppercase Alphabet";
    }
 
    return 0;
}

Read Also: C++ Program To Calculate Gross Salary

Output

Enter an uppercase alphabet
F
Lowercase Alphabet : f
Enter an uppercase alphabet
g
Not an uppercase Alphabet

Final Words

Do we hope you enjoy the article How To Convert Uppercase To Lowercase In C++?. The reason for that is that we hope that all your doubts and all doubts will be resolved through this article. Thanks

Hi, I'm Ranjith a full-time Blogger, YouTuber, Affiliate Marketer, & founder of Coding Deekshi. Here, I post about programming to help developers.

Share on:

Leave a Comment