单项选择题

下列程序的输出结果是( )。
#include<stdio.h>
main()
int a=2,b=3,p;
p=f(a,b);
printf("%d",p);
int f(a,b)
int c;
if(a>b)c=1;
else if(a==b)c=0;
else c=-1;
return(c);

A.-1
B.0
C.1
D.2
<上一题 目录 下一题>
热门 试题

单项选择题
下列程序的运行结果为( )。 #include<stdio.h> void abc(char*str) int a,b,i,j; for(i=j=0;str[i]!=’ 0’;i++) if(str[i]!=’a’ str[j++]=str[i]; str[j]=’ 0’; void main() char str[]= abcdef ; abc(str); printf( str[]=%s ,str);
A.str[]=bcdef
B.str[]=abcdef
C.str[]=a
D.str[]=ab
单项选择题
有下列程序: fun(int x,int y) static int m=0,i=2; i+=m+1;m=i+x+y;return m; main() int j=1,m=1,k; k=fun(j,m);printf( %d, ,k); k=fun(j,m);printf( %d n .k); 执行后的输出结果是( )。
A.5,5
B.5,11
C.11,11
D.11,5
相关试题
  • 下列程序的输出结果是( )。 #include...
  • 下列程序中函数son()的功能是对数组a中的...
  • 有下列程序: fun(int x,int y) sta...
  • 下列程序的运行结果为( )。 #include...
  • 结构化分析方法是面向( )的自顶向下、逐...