In case of a user enters a lower case how to change it to up

In case of a user enters a lower case, how to change it to upper case immediately. Please help.

ien et trecute Tool Astyle windom Help using namespace st 22, ile 1.15 2(minimum const double Xbase smile -3,7s, Seinimum 25. 15.00, Srinute -a-se, Leile -2.75, Lminimum 18.55 duble x, totals, totalu, baserare, per inute, persile, tetal.sk, surges, surgeLi \"Enter the minutes cout \"Enter the wiles cin di cout Enter \"X\" for uberk or \"S for surv or \"L\' for luxury: \"I Enter \"Y\" if surge N\' if not option 3 cout c Enter surge multip xnile) 12 if (Merds \"x\'ll option \'N\') anes Comple Debug Find Resurs all close output rilesome Di 22atteat .exe output Baze: 8355159 7595215 MiB 64 Dane persing in 0.015 seconds

Solution

Add function below to convert ur input word to uppercase.

Niw when user enter the word

cin>>words;

This function coverts to uppercase using the ASCII values,the ASCCI value of a is 097 and A is 065 similarly for all lower to uppercases the ASCII differenec is 32

void upper_string(char s[]) {
int char = 0;

while (s[char] != \'\\0\') {
if (s[char] >= \'a\' && s[char] <= \'z\') {
s[char] = s[char] - 32;
}
char++;
}
}

 In case of a user enters a lower case, how to change it to upper case immediately. Please help. ien et trecute Tool Astyle windom Help using namespace st 22, i

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site