How can wedifferentiate between upercase and lower case letters using ask key in c or c++
How can wedifferentiate between upercase and lower case letters using ask key in c or c++
Hello!
Here a snip set of code in c++ that ask for a lower case letter and make it Capital you should have what you need in there. Good luck.
#include <stdio.h>
int main(int argc, char* argv[])
{
char low = "";
do
{
printf("Give me a lower case letter: ");
low = getchar();
}
while(!(low >= 'a' && low <= 'z'));
int dif = ('a'-'A');
printf("\n");
printf("The character chosed is: %c\n", low);
printf("The ascII code for this character is: %i\n\n", low);
printf("The uper case of this character is: %c and his ascii code is : %i\n\n", (low - dif), (low - dif));
printf("\n\n\n\n");
}
All times are GMT -7. The time now is 01:26 PM. |