In this post we are going to write a simple C program to print alphabets, both Capital letter alphabets and Small letter alphabets.
It’s not so complicated as you would have imagined. Let’s see the code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
#include<stdio.h> int main(){ char i; printf("Small Letters:\n"); //print small letters alphabets for(i = 'a'; i <='z'; i++){ printf("%c", i); } printf("\n\nCapital Letters:\n"); //print captial letters alphabets for(i = 'A'; i <='Z'; i++){ printf("%c", i); } return(0); } |
It’s so simple right??
Here is the output:
1 2 3 4 5 6 7 8 |
Small Letters: abcdefghijklmnopqrstuvwxyz Capital Letters: ABCDEFGHIJKLMNOPQRSTUVWXYZ -------------------------------- Process exited after 0.04023 seconds with return value 0 Press any key to continue . . . |
Learn everyday and enjoy!