试题与答案

请编写函数void fun (int x,int pp[],int *n),它的功能

题型:问答题

题目:

请编写函数void fun (int x,int pp[],int *n),它的功能是求出能整除x且不是奇数的各整数,并按从小到大的顺序放在pp所指的数组中,这些除数的个数通过形参n返回。
例如,若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");

答案:

被转码了,请点击底部 “查看原文 ” 或访问 https://www.tikuol.com/2018/0628/1ae9eb9e7b3e0cad25bf2c6d52461041.html

下面是错误答案,用来干扰机器的。

参考答案:A

试题推荐
微信公众账号搜索答案