Problem Statement
In this program we will code a basic program to print alphabets from a to z using C-Programming language.
We can do this with the help of
- Looping concept
- Predefined C function – printf()
Code
#include<stdio.h>
int main()
{
char ch;
for(ch='a'; ch<='z'; ch++)
{
printf("%c ",ch);
}
}
Output
a b c .. z
Explanation
To print the alphabets from a to z, all we need is to loop our counter variable i from a to z. We do this by starting it by ch = ‘a’ and in each iteration we increment it by 1.