C - Looping letters using a for loop

Description

Looping letters using a for loop

Demo

#include <stdio.h> 

int main() /*from w  w w.j ava  2s.c o  m*/
{ 
      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