A、A.交换*p1和*p2的值
B、B.语法正确.但无法交换*p1和*p2的值
C、C.交换*p1和*p2的地址
D、D.有语法错误
第1题
例如,若x中的值为24,则有6个数符合要求,它们是2, 4, 6, 8, 12, 24。
注意:部分源程序给出如下。
请勿改动主函数main和其他函数中的任何内容,仅在函数fun的花括号中填入所编写的若干语句。
试题程序:
include<conio.h>
include<stdio.h>
void fun(int x,int PP[],int *n)
{
}
main ()
{
int x,aa[1000],n,i;
clrscr() ;
printf("\nPlease enter an integer number:
\n ") ;
scanf("%d",&X);
fun(x,aa,&n);
for(i=0;i<n;i++)
printf("%d",aa[i]);
printf("\n");
}
第2题
#include<stdio.h>
void fun(int P)
{int d=2;
P=d++;printf(“%d”,P);}
main( )
{int a=1;
fun(A);prinff(“%.d\n”,A);}
程序运行后的输出结果是
A.32
B.12
C.21
D.22
第3题
A.ABCDEFG
B.DEFGABC
C.GFEDCBA
D.CBADGFE
第4题
A.1
B.7
C.9
D.11
第5题
例如,一维数组中的原始内容为1,2,3,4,5,6,7, 8,9,10,11,12,13,14,15,p的值为6。移动后,一维数组中的内容应为7,8,9,10, 11,12,13,14,15,1, 2, 3, 4, 5, 6。
注意:部分源程序给出如下。
请勿改动主函数main和其他函数中的任何内容,仅在函数fun的花括号中填入所编写的若干语句。
试题程序:
include<stdio.h>
define N 80
void fun(int *w,int p,int n)
{
}
main()
{
int a[N]={1,2,3,4,5,6,7,8,9,10,11, 12,13,14,15};
int i,p,n=15;
printf("The original data:\n");
for(i=0;i<n;i++)
printf("%3d",a[i]);
printf("\n\nEnter p:");
scanf("%d",&p);
fun(a,p,n);
printf("\nThe data after moving:\n");
for(i=0;i<n;i++)
printf("%3d",a[i]);
printf("\n\n");
}
第6题
例如,一维数组中的原始内容为1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, P的值为6。移动后,一维数组的内容应为7, 8, 9, 10, 11, 12, 13, 14, 15, 1, 2, 3, 4, 5, 6。
[注意] 部分源程序给出如下。
请勿改动主函数main和其他函数中的任何内容,仅在函数fun的花括号中填入所编写的若干语句。
[试题源程序]
inciude <stdio.h>
define N 80
void fun(int *w, int p, int n)
{
}
main()
{
int a[N]=(i, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
int i, P, n=15;
printf("The original data:\n");
for(i=0; i<n; i++)
printf("%3d", a[i]);
printf("\n\nEnter p: ");
scanf("%d", &p);
fun(a, P, n);
printf("\nThe data after moving:\n");
for(i=0; i<n; i++)
printf("%3d", a[i]);
printf("\n\n");
}
第7题
例如,一维数组中的原始内容为1,2,3,4,5,6,7, 8,9,10,11,12,13,14,15,p的值为3。移动后,一维数组中的内容应为5,6,7,8,9,10,11,12,13,14,15, 1, 2, 3, 4。
注意:部分源程序给出如下。
请勿改动主函数main和其他函数中的任何内容,仅在函数fun的花括号中填入所编写的若干语句。
试题程序:
include <stdio.h>
define N 80
void fun(int *w, int p, int n)
{
}
main ()
{
int a[N]={1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
int i, p, n=15;
printf("The original data:\n");
for(i=0;i<n;i++)
printf("%3d",a[i]);
printf("\n\nEnter p: ");
scanf("%d",&p);
fun(a,p,n);
printf("\nThe data after moving:\n");
for(i=0;i<n;i++)
printf("%3d",a[i]);
printf("\n\n");
}
第8题
#include <stdio.h>
void fun(int p)
{ int d=2;
p=d++; printf("%d",p);}
main()
{ int a=1;
fun(a); printf("%d\n",a);}
程序运行后的输出结果是
A)32
B)12
C)21
D)22
第9题
fun(int x)
{int p;
if(x==0‖x==1) return(3) ;
p=x-fun(x-2) ;
return p;
}
main()
{printf("%d\n",fun(7) );}
执行后的输出结果是( )。
A.7
B.3
C.2
D.0
第10题
A.7
B.3
C.2
D.0
为了保护您的账号安全,请在“上学吧”公众号进行验证,点击“官网服务”-“账号验证”后输入验证码“”完成验证,验证成功后方可继续查看答案!