c语言函数与宏定义的应用,C语言第3次实_函数与宏定义的应用.doc

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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值