ahmed0saber

Uppercase to lowercase in C++

Nov 9th, 2020
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.23 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3. char uptolow(char c)
  4. {
  5.     if(c>='A'&&c<='Z')
  6.     {
  7.         return c+32;
  8.     }
  9.     return c;
  10. }
  11. int main()
  12. {
  13.     for(char c='A';c<='z';c++)
  14.     {
  15.         cout<<c<<"\t"<<(int)c<<"\t"<<uptolow(c)<<endl;
  16.     }
  17. }
Advertisement
Add Comment
Please, Sign In to add comment