c语言中不同整数类型的显示

1、

#include <stdio.h>

int main(void)
{
    signed short ss= 100;
    unsigned short us= 100;
    
    signed int si= 100;
    unsigned int ui= 100;
    
    signed long sl= 100;
    unsigned long ul= 100;
    
    signed long long sll= 100;
    unsigned long long ull= 100;
    
    printf("signed short: %hd.\n", ss);
    printf("unsigned short: %u.\n\n", us);
    
    printf("signed int: %d.\n", si);
    printf("unsigned int: %u.\n\n", ui);
    
    printf("signed long: %ld.\n", sl);
    printf("unsigend long: %lu.\n\n", ul);
    
    printf("signed long long: %lld.\n", sll);
    printf("unsigned long long: %llu.\n", ull);
    
    return 0;
}

c语言中不同整数类型的显示

 

上一篇:2021-07-10 初学c/c++,知识点整理


下一篇:7.8学习