题目详情
当前位置:首页 > 职业培训考试
题目详情:
发布时间:2023-10-20 00:29:07

[单选题]有以下程序
#include <stdio.h>
#define F(x,y) (x)*(y)
Main()
{ int a=3,b=4;
Printf("%d\n",F(a++,b++));
}
程序运行后的输出结果是()。
A.12
B.15
C.16
D.20

更多"[单选题]有以下程序#include &lt;stdio.h&gt;#"的相关试题:

[单选题]有以下程序
#include
#define N 5
#define M N+1
#define f(x) (x*M)
Main()
{ int i1,i2;
I1=f(2);
I2=f(1+1);
Printf ("%d %d\n",i1,i2);
}
程序的运行结果是()。
A.12 12
B.11 7
C.11 11
D.12 7
[单选题]有以下程序
#include
#define N 4
Void fun(int a[][N],int b[])
{ int i;
For(i=0;i}
Main()
{ int x[][N]={{1,2,3},{4},{5,6,7,8},{9,10}},y[N],i;
Fun(x,y);
For(i=0;iPrintf("\n");
}
程序的运行结果是()。
A.1,2,3,4,
B.1,0,7,0,
C.1,4,5,9,
D.3,4,8,10,
[单选题]以下程序的输出结果是()。
#include
#define FUDGE(y) 2.84+y
#define PR(a) printf("%d",(int)(a) )
#define PRINT1(a) PR(a);putchar('\n')
Main()
{ int x=2;
PRINT1(FUDGE(5)*x);
}
A.11
B.12
C.13
D.15
[单选题]有以下程序
#include
#include
Void fun( char s[][10],int n)
{ char t; int i,j;
For(i=0;iFor(j=i+1;j/* 比较字符串的首字符大小,并交换字符串的首字符 */
If(s[i][0]>s[j][0]) {t=s[i][0];s[i][0]=s[j][0];s[j][0]=t;}
}
Main()
{ char ss[5][10]={"bcc","bbcc","xy","aaaacc","aabcc"};
Fun(ss,5); printf("%s,%s\n",ss[0],ss[4]);
}
程序的运行结果是()。
A.xy,aaaacc
B.aaaacc,xy
C.xcc,aabcc
D.acc,xabcc
[单选题]有以下程序
#include
#include
Int fun(int n)
{ int *p;
P=(int*)malloc(sizeof(int));
*p=n; return *p;
}
Main()
{ int a;
A=fun(10); printf("%d\n",a+fun(10));
}
程序的运行结果是()。
A.0
B.10
C.20
D.出错
[单选题]有以下程序
#include
#include
Typedef struct{ char name[9]; char sex; float score[2]; } STU;
Void f(STU a)
{ STU b={"Zhao",'m',85.0,90.0};
Int i;
Strcpy(a name,b.name);
A sex=b sex;
For(i=0;i<2;i++)
A score[i]=b score[i];
}
Main()
{ STU c={"Qian",'f',95.0,92.0};
F(c);
Printf("%s,%c,%2.0f,%2.0f\n",c.name,c.sex,c.score[0],c.score[1]);
}
程序的运行结果是()。
A.Qian,f,95,92
B.Qian,m,85,90
C.Zhao,f,95,92
D.Zhao,m,85,90
[单选题]以下程序的输出结果是()。
#include
#include
Main() {
Char str[12]={s','t','r','i','n','g'};
Printf("%d\n",strlen(str) );
}
A.6
B.7
C.11
D.12
[单选题]有以下程序
#include
Struct NODE
{int num; struct NODE *next; }
Main()
{struct NODE *p,*q,*r;
P=(struct NODE *)malloc(sizeof(struct NODE));
Q=(struct NODE *)malloc(sizeof(struct NODE));
R=(struct NODE *)malloc(sizeof(struct NODE));
P->num=10;q->num=20;r->num=30;
P->next=q;q->next=r;
Printf("%d\n",p->num+q->next->num);
}
程序运行后的输出结果是()。
A.10
B.20
C.30
D.40
[单选题]有以下程序
#include
Void WriteStr(char *fn,char *str)
{ FILE *fp;
Fp=fopen(fn,"w");
Fputs(str,fp);
Fclose(fp);
}
Main()
{
WriteStr("t1.dat","start");
WriteStr("t1.dat","end");
}
程序运行后,文件t1.dat中的内容是()。
A.start
B.end
C.startend
D.endrt
[单选题]有以下程序
#include
Void fun(char *t, char *s)
{ while(*t!=0 ) t++;
While((*t++=*s++)!=0);
}
Main()
{ char ss[10]= "acc",aa[10]= "bbxxyy";
Fun(ss,aa); printf("%s,%s\n",ss,aa);
}
程序的运行结果是()。
A.accxyy,bbxxyy
B.acc,bbxxyy
C.accxxyy,bbxxyy
D.accbbxxyy,bbxxyy
[单选题]有以下程序
#include
Int fun(char s[])
{ int n=0;
While(*s<='9'&&*s>='0') { n=10*n+*s-'0';s++;}
Return(n);
}
Main()
{ char s[10]={ 6', '1','*','4','*', '9', '*', '0', '*'};
Printf("%d\n",fun(s));
}
程序的运行结果是()。
A.9
B.61490
C.61
D.5
[单选题]有以下程序
#include
Struct tt
{ int x; struct tt *y ; }*p;
Struct tt a[4]={20,a+1,15,a+2,30,a+3,17,a};
Main()
{ int i;
P=a;
For(i=1;i<=2;i++) { printf("%d, ",p->x); p=p->y; }
}
程序的运行结果是()。
A.20,30,
B.30,17,
C.15,30,
D.20,15,
[单选题]有以下程序
#include
Main(int argc, char *argv [])
{int i=1,n=0;
While(iPrintf("%d\n",n);
}
该程序生成的可执行文件名为:proc.exe。若运行时输入命令行:
Proc 123 45 67
则程序的输出结果是()。
A.3
B.5
C.7
D.11
[单选题]有以下程序
#include
Struct STU
{char name[10];
Int num;
};
Void f(char *name, int num)
{ struct STU s[2]={{"SunDan",20044},{"Penghua",20045}};
Num=s[0].num;
Strcpy(name,s[0].name);
}
Main()
{ struct STU s[2]={{"YangSan",20041},{"LiSiGao",20042}},*p;
P=&s[1]; f(p->name,p->num);
Printf("%s %d\n",p->name,p->num);
}
程序运行后的输出结果是()。
A.SunDan 20042
B.SunDan 20044
C.LiSiGuo 20042
D.YangSan 20041
[单选题]有以下程序
#include
Struct NODE{
Int num;
Struct NODE *next;
};
Main()
{ struct NODE *p,*q,*r;
Int sum=0;
P=(struct NODE *)malloc(sizeof(struct NODE));
Q=(struct NODE *)malloc(sizeof(struct NODE));
R=(struct NODE *)malloc(sizeof(struct NODE));
P->num=1;q->num=2;r->num=3;
P->next=q;q->next=r;r->next=NULL;
Sum+=q->next->num;sum+=p->num;
Printf("%d\n",sum);
}
执行后输出结果是()。
A.3
B.4
C.5
D.6
[单选题]有以下程序
#include
Struct st
{ int x,y;} data[2]={1,10,2,20};
Main()
{ struct st *p=data;
Printf("%d,",p->y);
Printf("%d\n",(++p)->x);
}
程序的运行结果是()。
A.10,1
B.20,1
C.10,2
D.20,2

我来回答:

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

订单号:

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