有以下程序
#include
double f(double x);
main()
{ double a=0; int i;
for(i=0;i<30;i+=10) a+=f((double)i);
printf(“%5.0f\n”, a);
}
double f(double x)
{ return x*x+1;}
程序运行后的输出结果是()
A. 503
B. 401
C. 500
D. 1404
#include
#include
#include
main()
{ char *p; int i;
p=(char *)malloc(sizeof(char)*20);
strcpy(p,"welcome");
for(i=6;i>=0;i--) putchar(*(p+i));
printf("\n "); free(p);
}
#include
struct ord
{ int x,y;}dt[2]={1,2,3,4};
main()
{
struct ord *p=dt;
printf("%d,",++(p->x)); printf("%d\n",++(p->y));
}
程序运行后的输出结果是
A)1,2
B)4,1
C)3,4
D)2,3
#include
【12】 ;
main()
{ double x,y,(*p)();
scanf("%lf%lf",&x,&y);
p=avg;
printf("%f\n",(*p)(x,y));
}
double avg(double a,double b)
{ return((a+b)/2);}