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 <='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); }
Out Put
Small Letters: abcdefghijklmnopqrstuvwxyz Capital Letters: ABCDEFGHIJKLMNOPQRSTUVWXYZ -------------------------------- Process exited after 0.04023 seconds with return value 0 Press any key to continue . . .
- What is C++?
- Write a c program to subtract two numbers.
- Write a c program to add two numbers
- Write a c program to swap two numbers.
- Write a c program to check even or odd
- Write a c program to print alphabets from a to z
- Write a c program print 1 to 100
- Hello World Example
- C Program
- Why Use C?
- Facts about C
- C PROGRAM OVERVIEW
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!