C++ Programming

 

Lowercase to Uppercase

Program to convert all lowercase characters to Uppercase


Source Code

#include <iostream.h>
#include <ctype.h> // required for the character function library

void ConvertToUpper(char []);

int main()
{
const int MAXCHARS = 100;
char message[MAXCHARS];

cout << "\nType in any sequence of characters: ";

cin.getline(message,MAXCHARS);

ConvertToUpper(message);

cout << "The characters just entered, in uppercase are: "
<< message << endl;

return 0;
}

// this function converts all lowercase character to uppercase
void ConvertToUpper(char message[])
{
for(int i = 0; message[i] != '\0'; i++)
message[i] = toupper(message[i]);

return;
}
 


DISCLAIMER

Paked and the contributors are not responsible for any errors contained and are not liable for any damages resulting from the use of this material.  (Disclaimer)

 

 

Home     Disclaimer     Advertise      Contact us     

Copyright © 2006-08 Paked.com. All rights reserved.

Note: Site best viewed at 1024 x 768 or higher screen resolution

 

footer image footer image