C program to print all uppercase and lowercase alphabets

In this C program, we are going to print all uppercase alphabets (from 'A' to 'Z') and lowercase alphabets (from 'a' to 'z').

To print uppercase alphabets, we are using a for loop from 'A' to 'Z' and printing the characters, and to print lowercase alphabets, we are using a another for loop from 'a' to 'z' and printing the characters.

Print Alphabets in Upper and Lower case using C program

/*C program to print all upper case and lower case alphabets.*/
 
#include <stdio.h>
 
int main()
{
    char i;
 
    printf("Capital (upper) case characters:\n");
    for(i='A'; i<='Z'; i++)
        printf("%c ",i);
 
    printf("\n\nLower case characters:\n");
    for(i='a'; i<='z'; i++)
        printf("%c ",i);
     
    return 0;
}

Output

    Capital (upper) case characters:
    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
    
    Lower case characters:
    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

C Looping Programs »


Comments and Discussions!

Load comments ↻






Copyright © 2024 www.includehelp.com. All rights reserved.