Example
Input
Output
Alphabets: a, b, c, d, e, ... , z
/**
* C program to print all alphabets using while loop
*/
#include <stdio.h>
int main()
{
char ch = 'a';
printf("Alphabets from a - z are: \n");
while(ch<='z')
{
printf("%c\n", ch);
ch++;
}
return 0;
}
Program to display alphabets using ASCII value
/**
* C program to display all alphabets using while loop
*/
#include <stdio.h>
int main()
{
int ch = 97;
printf("Alphabets from a - z are: \n");
while(ch<=122)
{
printf("%c\n", ch);
ch++;
}
return 0;
}
/*
Output :
Alphabets from a - z are:
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
*/