C - Looping letters using a for loop

Description

Looping letters using a for loop

Demo

#include <stdio.h> 

int main() /*  w  w  w  .  j av  a2s .  c  om*/
{ 
      char alphabet; 

      for(alphabet='A';alphabet<='Z';alphabet=alphabet+1) 
      { 
          printf(" %c",alphabet); 
      } 
      putchar('\n'); 

      for(alphabet='A';alphabet<='Z';alphabet=alphabet+1) 
      { 
          printf("%d ",alphabet); 
      } 
      putchar('\n'); 
      return(0); 
}

Result

Related Example