C语言第3次实_函数与宏定义的应用
实 验 报 告
(计算机类)
课程名称:C语言程序设计实验项目:函数与宏定义的应用计算机号:院系专业:班级学号:学生姓名:实验日期:
信息管理学院
实践教学中心
实验目的:
了解函数的定义方法,
实参与形参的传递
理解函数的调用;
了解递归调用实验内容:
1.编写程序实现以下函数:
2.求n以内(不包括n)同时能被3和7的所有自然数之和的平方根s例如若n为1000时,函数值应为:s=153.909064。#include
#include
main()
{
double x,y;
scanf("%lf",&x);
y=fabs(pow(x,5)+2)/sin(sqrt(x)+exp(3.1));
printf("%lf\n",y);
}
(2)
#include
#include
void main()
{
double pfg(int n);
int n;
scanf("%d",&n);
printf("%f\n",pfg(n));
}
double pfg(int n)
{ int i,sum=0;
for(i=1;i
if(i%3==0&&i%7==0) sum+=i;
return sqrt(sum);
}程序调试及实验总结:
1、
2、教师评语:
该学生态度端正,能按时完成试验项目,实验中发现问题,在教师的启发下能解决问题
成 绩主讲教师: 年 月 日
borrower's repayment and common people (spouse or others) original and copy of valid identity documents, register field accounts should provide valid proof of residence; (C) original and copy of marital status, single station shall be provided, or unmarried certificate issued by the Home Department
borrower's repayment and common people (spouse or others) original and copy of valid identity documents, register field accounts should provide valid proof of residence; (C) original and copy of marital status, single station shall be provided, or unmarried certificate issued by the Home Department
borrower's repayment and common people (spouse or others) original and copy of valid identity documents, register field accounts should provide valid proof of residence; (C) original and copy of marital status, single station shall be provided, or unmarried certificate issued by the Home Department
制