有以下程序
int fun(int x,int y,int *cp,int *dp)
{ *cp=x+y; *dp=x-y; }
main()
{ int a, b, c, d;
a=30; b=50;
fun(a,b,&c,&d);
printf("%d,%d\n", c, d);
}
输出结果是()。
A. 50,30
B. 30,50
C. 80,-20
D. 80,20
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-5ca8-c089-2897e0346514.html
点击查看答案
有如下定义
struct person{char name[9]; int age;};
strict person class[10]={"Johu", 17,
"Paul", 19
"Mary", 18,
"Adam 16,};
根据上述定义,能输出字母M的语句是()。
A. prinft("%c\n",class[3].mane);
B. pfintf("%c\n",class[3].name[1]);
C. prinft("%c\n",class[2].name[1]);
D. printf("%^c\n",class[2].name[0]);
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6090-c089-2897e0346501.html
点击查看答案
设fp已定义,执行语句fp=fopen("file","w");后,以下针对文本文件file操作叙述的选项中正确的是( )。
A. 写操作结束后可以从头开始读
B. 只能写不能读
C. 可以在原有内容后追加写
D. 可以随意读和写
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-54d8-c089-2897e0346503.html
点击查看答案
设有以下宏定义:
#define N 3
#define Y(n) ( (N+1)*n)
则执行语句:z=2 * (N+Y(5+1));后,z的值为()。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-58c0-c089-2897e0346502.html
点击查看答案
有以下程序
main()
{int i,t[][3]={9,8,7,6,5,4,3,2,1};
for(i=0;i<3;i++) printf("%d",t[2-i][i]);
}
程序执行后的输出结果是()。
A. 7 5 3
B. 3 5 7
C. 3 6 9
D. 7 5 1
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-58c0-c089-2897e0346512.html
点击查看答案
有以下程序
#include "stdio.h"
#include "string.h"
void main( )
{ char str[100] ="How do you do";
strcpy( str + strlen(str)/2, "es she");
printf("%s\n", str);
}
执行后的输出结果是( )。
A. How do you do
B. es she
C. How are you
D. How does she
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6860-c089-2897e0346513.html
点击查看答案
#include
void disp(char *string)
{
if(*string)
{
disp( string+1);
putchar (*string);
}
}
void main()
{
disp("abcdefg");
}
程序的运行结果是( )。
A. abcdefg
B. gfedcba
C. abcd
D. dcba
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6860-c089-2897e0346506.html
点击查看答案
有以下程序
#include
struct S
{ int a,b;}data[2]={10,100,20,200};
main()
{ struct S p=data[1];
printf("%d\n",++(p.a));
}
程序运行后的输出结果是()。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6478-c089-2897e0346503.html
点击查看答案
在C 语言中,引用数组元素时,其数组下标的数据类型允许是()。
A. 整型常量
B. 整型表达式
C. 整型常量或整型表达式
D. 任何类型的表达式
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-4d08-c089-2897e0346502.html
点击查看答案
有以下程序
#include
void fun(int *x,int i)
{*x=*(x+i);}
void main()
{ int a[8]={1, 2, 3, 4, 5, 6, 7, 8},i;
fun(a,2);
for(i=0; i<8/2; i++)
{ printf("%d",a[i]);}
printf("\n");
}
执行后的输出结果是( )。
A. 3234
B. 3231
C. 2334
D. 2331
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6860-c089-2897e0346515.html
点击查看答案