题目详情
当前位置:首页 > 职业培训考试
题目详情:
发布时间:2023-11-12 07:22:03

[单项选择]下列函数的运行结果是
#include<iostream.h>
int f(int a,int B)
int c;
if(a>b) c=1
else if(a=b) c=0;
else c=-1;
return(c) ;
void main( )
int i=2,j=3;
int p=f(i,j);
cout << p;
A. -1
B. 1
C. 2
D. 编译出错,无法运行

更多"下列函数的运行结果是 #include<iostream.h> "的相关试题:

[单项选择]下列函数的运行结果是
#include<iostream.h>
int f(int a,int b)
int c;
if(a>b) c=1;
else if(a==b) c=0;
else c=-1;
return(c) ;
void main( )
int i=2,j=3;
int p=f(i, j) ;
cout < < p;
A) -1 B) 1
C) 2 D) 编译出错,无法运行
[单项选择]下列函数的运行结果是 #include<iostream.h> int f(int a,int b) { int c; if(a>b) c=1; else if(a==b) c=0; else c=-1; return(c) ;} void main( ) { int i=2,j=3; int p=f(i, j) ; cout < < p;} A) -1 B) 1 C) 2 D) 编译出错,无法运行
[单项选择]下列函数的运行结果是( )。
#include<iostream.h>
int f(int a,int b)
int c;
if(a>b)c=1;
else if(a==b)c=0;
else c=-1;
return(c);
void main( )
int i=2,j=3;
iht p=f(i,j);
cout<<p;
A. -1
B. 1
C. 2
D. 编译出错,无法运行
[单项选择]下列函数的运行结果是( )。
#include<iostream.h>
int f(int a,int b)
int c;
if(a>b) c=1;
else if(a==b)c=0
elsec=-1;
return(c);
void main( )
int i=2,j=3;
int p=f(i,j);
cout<<p:
A. -1
B. 1
C. 2
D. 编译出错,无法运行
[单项选择]下列函数的运行结果是( )。
#include<iostream.h>
int add(int a,int b);
void main( )
extern int x,y;
cout<<add(x,y)<<end1;
int x(20),y(5);
int add(int a,int b)

int s=a+b;
return s;

A. 25
B. 30 C) 20 D) 15
[填空题]

以下程序运行时输出结果是()。
#include
int f(int x,int y)
{retum x+y; }
void main( )
{double a=5.5,b=2.5;
printf("%d",f(a,b));
}


[单项选择]下列函数的运行结果是( )。
#include <iostream.h>
int add(int a,int b);
void main( )

extern int x,y;
cout<<add(x,y)<<endl;

int x(20),y(5);
int add(int a,int b)

int s=a+b;
return s;

A. 25
B. 30
C. 20
D. 15
[填空题]

以下程序运行时输出结果是()。
#include
#include
int count(char s[])
{ int i=0;
if(s[i]==’/0’) return 0;
while(isalpha(s[i]))i++;
while(!isalpha(s[i])&&s[i]!=’/O’)i++;
return 1+count(&s[i]);
}
void main( )
{char line[]="one world,one dream.";
printf("%d",count(line));
}


[单项选择]下列函数的运行结果是( )。
#include <stdio.h>
main( )
int 1=2, p;
int j, k;
j=i; k=++i; p=f(j, k);
printf("%d", p);
int f(int a, int b)
int c;
if(a>b) c=1;
else if(a==b) c=0;
else c=-1;
return(c);
A. -1
B. 1
C. 2
D. 编译出错,无法运行
[填空题]下面程序的运行结果是______。
#include
int f(int a[],int n)
if(n>1)
return a[0]+f(a+1,n-1);
else
return a[0];main( )
int aa[10]=1,2,3,4,5,6,7,8,9,10,s;
s=f(aa+2,4); printf("%d/n",s);

[填空题]

下面程序的运行结果是()。
#include <stdio.h>
int f(int a[],int n)
{ if(n>1)
return a[0]+f(a+1,n-1);
else
return a[0];
}
main( )
{int aa[10]={12,3,4,5,6,7,8,9,10},s;
s=f (aa+2,4); printf("%d/n",s); }


[填空题]下面程序的运行结果是:【 】。 #include int f(int a[],int n) {if(n>1) return a[0]+f(a+1,n一1); else return a[0]; } main( ) { int aa[10]={1,2,3,4,5,6,7,8,9,10},S; S=f(aa+2,4);printf("%d\n",S); }

我来回答:

购买搜题卡查看答案
[会员特权] 开通VIP, 查看 全部题目答案
[会员特权] 享免全部广告特权
推荐91天
¥36.8
¥80元
31天
¥20.8
¥40元
365天
¥88.8
¥188元
请选择支付方式
  • 微信支付
  • 支付宝支付
点击支付即表示同意并接受了《购买须知》
立即支付 系统将自动为您注册账号
请使用微信扫码支付

订单号:

截图扫码使用小程序[完全免费查看答案]
请不要关闭本页面,支付完成后请点击【支付完成】按钮
恭喜您,购买搜题卡成功
重要提示:请拍照或截图保存账号密码!
我要搜题网官网:https://www.woyaosouti.com
我已记住账号密码