3、以下正确的函数定义是( ).A.double fun(int x,int y); {int z; z=x+y; return z;}3、以下正确的函数定义是( ).A.double fun(int x,int y); {int z; z=x+y; return z;}B.fun(int x,y) {int z; return z;}C.double fun(int x,int y); {double z; z=x+y;return z;}D.double fun(x, y) int x,y;{double z; z=x+y; return z;}
问题描述:
3、以下正确的函数定义是( ).A.double fun(int x,int y); {int z; z=x+y; return z;}
3、以下正确的函数定义是( ).
A.double
fun(int x,int y);
{int z;
z=x+y; return z;}
B.fun(int x,y)
{int z; return z;}
C.double
fun(int x,int y);
{double z;
z=x+y;
return z;}
D.double fun(
x, y)
int x,y;
{double z; z=x+y; return z;}
答
C对的.AB返回值和函数定义不一致,D的int x,y定义不能在fun()和{}中间