打印输出:unsigned int, short, long, long long

#include stdio.hint main(void){unsigned int un = 3000000000; /* system with 32-bit int */short end = 200;/* and 16-bit short*/

编程学习网为您整理以下代码实例,主要实现:打印输出:unsigned int, short, long, long long,希望可以帮到各位朋友。

#include <stdio.h>

int main(voID)
{
    unsigned int un = 3000000000; /* system with 32-bit int */
    short end = 200;              /* and 16-bit short       */
    long big = 65537;
    long long verybig = 12345678912345;

    printf("un = %u and not %d\n", un, un);
    printf("end = %hd and %d\n", end, end);
    printf("big = %ld and not %hd\n", big, big);
    printf("verybig= %lld and not %ld\n", verybig, verybig);

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

相关文档推荐

#include iostreamusing namespace std;int main () {// number definition:shorts;inti;longl;floatf;
#include iostream#include ctimeusing namespace std;void getSeconds(unsigned long *par);
// #include stdio.h#include math.hint main() {shorts;inti;longl;floatf;double d;printf( sin(s): %f\\n, sin(10));
以下符号表示整数类型的范围限制。类型最低限制最高限制charCHAR_MINCHAR_MAXshort
#include stdio.hint main(void) {int i;const int numFibs = 20;unsigned long long int Fibonacci[numFibs];
#include stdio.hint main(){int counter = 100;unsigned long int sum = 0;for (int i = 1; i = counter; i++) {