对char类型的值进行算术运算

下面是一个类型为char的算术运算示例:#include stdio.h int main(void) { char letter = C;// letter contains the decimal code value 67

编程学习网为您整理以下代码实例,主要实现:对char类型的值进行算术运算,希望可以帮到各位朋友。

下面是一个类型为char的算术运算示例:

#include <stdio.h> 

int main(voID) 
{ 
    char letter = 'C';                          // letter contains the decimal code value 67
    printf("The character is %c\n", letter);

    letter = letter + 3;                        // letter Now contains 70, which is 'F'

    printf("The character is %c\n", letter);
    return 0; 
}

本文标题为:对char类型的值进行算术运算