char变量的数字性质

#include stdio.hint main( void ){char c1 = a;char c2 = 90;/* Print variable c1 as a character, then as a number */

编程学习网为您整理以下代码实例,主要实现:char变量的数字性质,希望可以帮到各位朋友。

#include <stdio.h>

int main( voID )
{
    char c1 = 'a';
    char c2 = 90;
    /* Print variable c1 as a character, then as a number */

    printf("\nAs a character, variable c1 is %c", c1);
    printf("\nAs a number, variable c1 is %d", c1);

    printf("\nAs a character, variable c2 is %c", c2);
    printf("\nAs a number, variable c2 is %d\n", c2);

    return 0;//
}
本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐