How to Print Alphabet in C
A simple tutorial to print the entire alphabet using C language. Im using the Dev Cpp Compiler of Bloodshed.net.
Declare a header file
Put a main() function
Declare a variable alpha with a character data type.
We will use a looping structure to repeat the condition from letter ‘A’ to ‘Z’ then display it by using printf() function and format specifier %c together with the variable.
Whole Code:
Declare a header file
#include<stdio.h>
Put a main() function
int main()
{
}
Declare a variable alpha with a character data type.
char alpha;
We will use a looping structure to repeat the condition from letter ‘A’ to ‘Z’ then display it by using printf() function and format specifier %c together with the variable.
for ( alpha = 'A' ; alpha <= 'Z' ; alpha++)
{
printf("%c ", alpha);
}
return 0;
}
Whole Code:
#include<stdio.h>Result:
int main()
{
char alpha;
for ( alpha = 'A' ; alpha <= 'Z' ; alpha++)
{
printf("%c ", alpha);
}
return 0;
}
How to Print Alphabet in C
Reviewed by code-dev
on
9:33 PM
Rating:
No comments: