Write a c program to print alphabets from a to z

Introduction: In the realm of programming, learning the fundamentals of a language is essential. In this SEO-friendly article, we will explore how to write a C program that prints alphabets from A to Z. By the end of this guide, you’ll have a solid understanding of the logic and syntax required to achieve this task. So, let’s dive into the world of C programming!

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 . . .

Conclusion:

Congratulations! You have successfully written a C program that prints alphabets from A to Z. Understanding the basic structure and syntax of the program will serve as a solid foundation for your future C programming endeavors. Feel free to modify and expand upon this program to further explore the capabilities of the C language. Happy coding!

Leave a Comment