One - One Code All

Blog Content

C 语言实例 - 循环输出26个字母

每日一练 C/C++   2007-03-07 18:26:21
/*
* 循环输出 26 个字母。
*/
#include 

int main()
{
    char c;
 
    for(c = 'A'; c <= 'Z'; ++c)
       printf("%c ", c);
 
    printf("\n");
    return 0;
}


执行:gcc book027.c && ./a.out

输出: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 语言实例 - 阶乘
下一篇:C 语言实例 - 判断数字为几位数

The minute you think of giving up, think of the reason why you held on so long.