0
How to print alphabet in c uppercase and lowercase
4 odpowiedzi
+ 1
here it goes
char i, j;
for(i='A';i<='Z';i++) //uppercase
{
printf("%c", i) ;
}
for(i='a';i<='z';i++) //lowercase
{
printf("%c", i) ;
}
+ 1
sorry for that it was my mistake.
thanks.
0
but why you have taken j
0
// Prints the alphabet in format "Aa - Zz"
for (char ch = 'a'; ch <= 'z'; ch++)
{
printf("%c%c", (ch ^ 0x20), ch); // using bit flips to get the uppercase
}