How to write the alphabet in C with a loop?
The following codes display the 26 letters of the alphabet in C:
char c;
// Displays abcdefghijklmnopqrstuvwxyz
for (c='a'; c<='z' ; c++) printf ("%c", c);
// Displays ABCDEFGHIJKLMNOPQRSTUVWXYZ
for (c='A'; c<='Z' ; c++) printf ("%c", c);
Check this online example on repl.it.
The following codes display the 26 letters of the alphabet in C:
char c;
// Displays abcdefghijklmnopqrstuvwxyz
for (c='a'; c<='z' ; c++) printf ("%c", c);
// Displays ABCDEFGHIJKLMNOPQRSTUVWXYZ
for (c='A'; c<='Z' ; c++) printf ("%c", c);
Check this online example on repl.it.
The following codes display the 26 letters of the alphabet in C:
char c;
// Displays abcdefghijklmnopqrstuvwxyz
for (c='a'; c<='z' ; c++) printf ("%c", c);
// Displays ABCDEFGHIJKLMNOPQRSTUVWXYZ
for (c='A'; c<='Z' ; c++) printf ("%c", c);
Check this example online on repl.it.
| # | ID | Query | URL | Count |
|---|---|---|---|---|
| 0 | 12487 | en | https://en.ans.wiki/6059/how-to-write-the-alphabet-in-c-with-a-loop | 7 |