C++ Program:

- To convert string into UPPERCASE

Example:

User Input: hello World

Output: HELLO WORLD

#include <iostream>
using namespace std;

int main() {
  string s1;
  cout<<"Enter your string : ";
  getline(cin,s1);
  for(int i=0;i<s1.length();i++) {
    if(s1[i]>='a' && s1[i]<='z')
      s1[i]-=32;
  }
  cout<<"Your uppercase string : "<<s1;
  return 0;
}

Output:

  Enter your string : Have good day
  Your uppercase string : HAVE GOOD DAY
Program
basic

You should know first :

Lowercase alphabets : Starts from a (97) to z (122)

Uppercase alphabets : Starts from A (65) to z (90)

for(int i=0;i<s1.length();i++) {
  //Check for lowercase
  if(s1[i]>='a' && s1[i]<='z')
    s1[i]-=32;  //convert it to uppercase & store it back
}
  

To convert them to, all lowercase
for(int i=0;i<s1.length();i++) {
  //Check for uppercase
  if(s1[i]>='A' && s1[i]<='Z')
    s1[i]+=32;     //covert it to lowercase & store it back
}
  
Concept

Coming Soon !

Quick
Tutorial

Quote

Learn from yesterday, live for today, hope for tomorrow. The important thing is not to stop questioning.