Custom Search

 

 

 

 
 

 

Lowercase/ Uppercase


Binary Search | Bubble Sort | Selection Sort | Finding Maximum Value | Linear Search | Celsius to Fahrenheit | 10 Pseudo-random numbers | Calculating Average | Swapping Values | Lowercase/ Uppercase

Program to convert all lowercase characters to Uppercase

C++ 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;
}

Copyrights

Gary Bronson. "A First Book of C++: From Here to There " Thomson Learning.

                        

 

 

 

Custom Search
 

Home      Disclaimer      Advertise      Contact      Privacy Policy     

Copyright 2004-15 Paked.com. All rights reserved.

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