问题

34 ) 有以下程序

#include <stdio.h>

int f(int n);

main()

{ int a=3,s;

s=f(a);s=s+f(a);printf("%d\n",s);

}

int f(int n)

{ static int a=1;

n+=a++;

return n;

}

程序运行以后的输出结果是

A)7

B)8

C)9

D)10

参考答案
您可能感兴趣的试题
  • 有以下程序#include #define f(x) x*x*xmain(){ int a=3,s,t;s=f(a+1);t=f((a+1));printf(%d,%d\n,s,
  • 下面结构体的定义语句中,错误的是A)struct ord {int x;int y;int z;}; struct ord a;B)struct ord {int x;int y;int z;} st
  • 设有定义: char *c; ,以下选项中能够使字符型指针 c 正确指向一个字符串的是A ) char str[ ]= string;c=str;B ) scanf(%s,c);C ) c=g
  • 若有以下程序段int r=8;printf(%d\n,r$amp;>amp;$gt;1);输出结果是A ) 16B ) 8C ) 4D ) 2
  • 下列关于 C 语言文件的叙述中正确的是A ) 文件由一系列数据依次排列组成,只能构成二进制文件B ) 文件由结构序列组成,可以构成二进制文件或文本文件C ) 文件由数据序列组成,可以构成二进制文件或文
  • 程序流程图中的菱形框表示的是 【 2 】 。