-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy path16.cpp
More file actions
20 lines (18 loc) · 745 Bytes
/
Copy path16.cpp
File metadata and controls
20 lines (18 loc) · 745 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include<iostream>
using namespace std;
int main()
{
//to convert to lower case
char ch;
//getting the input from the user
cout<<"Enter a uppercase character : ";
cin>>ch;
//converting the to lower case letters
//since, lowercase letters has ascii value starting from 97 while uppercase letters starts from 65
//the difference between their starting characters are 32
//to convert to lowercase we will add 32 to the characters
cout<<ch<<" converted to lowercase --> "<<(char)(ch+32)<<endl;
//we can also perform the lowercase coversion using the tolower() function
cout<<ch <<" converted to lowercase (using tolower() function) --> "<<(char)tolower(ch)<<endl;
return 0;
}