This program will print the alphabet from A to Z in capital letters. In this program, I have printed the alphabets based on the ASCII code (Abbreviated from American Standard Code).
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
#include <stdio.h> //define the main funtion int main() { int i; printf("Output is:"); for(i=65; i<(65+26);i++) { //print the alphabets printf("%c ",i); } return 0; } |
Output is:A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Description: In the above program we used the “%c” format specifier to print the alphabet. In the ASCII code, 65 is the value of capital letter A. We have added 26 in 65 (65+26) and execute the for loop to print the alphabets from A to Z.
See the below ASCII code table.
If you like FreeWebMentor and you would like to contribute, you can write an article and mail your article to [email protected] Your article will appear on the FreeWebMentor main page and help other developers.
Article Tags: c program, c program examples, c program with output, c programs, letters of the alphabet to print