In case of a user enters a lower case, how to change it to upper case immediatel
ID: 3798448 • Letter: I
Question
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 secondsExplanation / Answer
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] != '') {
if (s[char] >= 'a' && s[char] <= 'z') {
s[char] = s[char] - 32;
}
char++;
}
}
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.