This program replaces the small letter vowels with capital letters. How do I get it to replace small letters with capital letters (for all of the letters, not only the vowels.) ?
^
Include the header file <cctype>.
It has library functions like tolower, toupper.
Also remember when you're inputting or outputting an array, you always have to do it in a loop since it contains more than 1 value.
#include<iostream>
#include<cstring>
#include<cctype>
usingnamespace std;
int main()
{
char n[100]; // create a character array called "n" for 100 memory location
cout<<"Enter a line of text: ";
cin.get(n,100);
for(int i=0; n[i]!='\0'; i++)
{
n[i] = toupper(n[i]); // turns everything it reads in to uppercase
}
cout<<"The new text: "<< endl;
for (int i = 0; n[i] != '\0'; i++)
{
cout<<n[i] << endl;
}
return 0;
}