Mega Code Archive

 
Categories / C Tutorial / Statement
 

Use char variable to control for loop

#include <stdio.h> int main() {     char b,a='a' ;     for(b='A';b<'K';b++) {          printf("%d - %c ",a,b);     }     putchar('\n');  /* end of line */     return(0); } 97 - A 97 - B 97 - C 97 - D 97 - E 97 - F 97 - G 97 - H 97 - I 97 - J