I come, I see, I conquer

                    —Gaius Julius Caesar

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::
  15 随笔 :: 339 文章 :: 128 评论 :: 146万 阅读
< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

1. What will be the output of the following code ?

复制代码
#include <stdio.h>

int main() 
{
    
int i = 3, j = 4;
    i 
? i++ : ++j;
    printf(
"i=%d, j=%d \n", i, j);
}
复制代码



2. What will be the output of the following C code ?

复制代码
#include <stdio.h>
#define product(x) (x*x)

int main() 
{
    
int i = 3, j, k;

    j 
= product(i++);
    k 
= product(++i);

    printf(
"j=%d, k=%d \n", j, k);

    
return 0;
}
复制代码



3. What will be the output of the following code?

复制代码
#include <stdio.h>

int main() 
{
    
int i = 5, j = 3;
    
!&& ++j;
    printf(
"i=%d, j=%d \n", i, j);
}
复制代码
posted on   jcsu  阅读(404)  评论(0编辑  收藏  举报
努力加载评论中...
点击右上角即可分享
微信分享提示