Write a c program to print alphabets from a to z

 

Write a C program to print alphabets from a to z using for loop. How to print alphabets using loop in C programming. Logic to print alphabets from a to z using for loop in C programming.

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:

Program

#include<stdio.h>
int main(){
	
	char i;
	
	printf("Small Letters:\n");
	//print small letters alphabets
	for(i = 'a'; i &lt;='z'; i++){
	    printf("%c", i);
	}
	
	printf("\n\nCapital Letters:\n");   
	//print captial letters alphabets
	for(i = 'A'; i &lt;='Z'; i++){
	    printf("%c", i);
	}
	return(0);
}

Out Put

Small Letters:
abcdefghijklmnopqrstuvwxyz
 
Capital Letters:
ABCDEFGHIJKLMNOPQRSTUVWXYZ
--------------------------------
Process exited after 0.04023 seconds with return value 0
Press any key to continue . . .

LEAVE A REPLY

Please enter your comment!
Please enter your name here