Coding Practice

Write a C program to print all alphabets from a to z. - using while loop

Print all alphabets from a to z. - using while loop
Sample Output
All alphabets from a to z.
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

Process returned 0 (0x0)   execution time : 0.055 s
Press any key to continue.
Source Code
#include<stdio.h>

int main()
{
    char c;

    printf("All alphabets from a to z.\n");

    c = 'a';
    while(c <= 'z')
    {
        printf("%c\n", c);
        c++;
    }
    return 0;
}
Sample Output
All alphabets from a to z.
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

Process returned 0 (0x0)   execution time : 0.055 s
Press any key to continue.

2 comments:

Change Theme
X