Need a project done?

C++ Programming Developer

Search This Blog

Convert Lower case alphabets to Upper case in C++

#include <iostream>
using namespace std;
int main()
{
 char string[20];
 cin.getline(string,20,'\n');
 for (int i = 0; i<20; i++)
 {
  if (islower(string[i]))
  {
   string[i] = char(toupper(string[i]));
  }
 }
 cout <<string;
}

No comments:

Post a Comment

"Don't let anyone ever make you feel like you don't deserve what you want."