[2018年最新整理]C语言课后实验设计题目及答案.docVIP

[2018年最新整理]C语言课后实验设计题目及答案.doc

  1. 1、本文档共19页,可阅读全部内容。
  2. 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
  3. 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  4. 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
  5. 5、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
  6. 6、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们
  7. 7、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
  8. 8、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
[2018年最新整理]C语言课后实验设计题目及答案

C语言实验题目及答案 1、实验项目一 C程序的编辑、编译、连接和运行 题目:编写程序,要求屏幕上显示如下信息: *********************** This is a C program . *********************** 程序: #include stdio.h void main() { printf(“***********************\n”); printf(“This is a C programn .\n”); printf(“***********************\n”); } 实验项目二 数据类型、运算符、表达式 题目 (1)程序填空:输入1 个实数x,计算并输出其平方根(保留1 位小数)。 填空 double x,root; root=sqrt(x); (2)输入一个大写英文字母,输出相应的小写字母。 填空 ch=ch+32; 1、#include stdafx.h #include stdio.h #include math.h int main(int argc, char* argv[]) { printf(This is a Cprogram\n); return 0; } 2、#include stdafx.h #include stdio.h #include math.h int main(int argc, char* argv[]) { double x; printf(x=); scanf(%lf,x); printf(%lf\n,sqrt(x)); return 0; } 2、实验项目三 顺序结构程序设计 题目 (1)编写程序,输入三角形的三边长a、b、c,求三角形面积area。 (2)设圆半径r=1.5,圆柱高h=3,求圆周长、圆面积、圆球表面积、圆球体积、圆柱体积。 (3)分别用getchar函数和scanf函数读入2个字符给变量c1、c2,然后分别用putchar函数和printf函数输出这两个字符。 实验项目四 分支结构程序设计 题目 输入四个整数,输出其中的最小值。 实验报告 1、主程序: // zx.cpp : Defines the entry point for the console application. // #include stdafx.h #include stdio.h #include math.h int main(int argc, char* argv[]) { float a,b,c,area,s; scanf(%f,%f,%f,a,b,c); s=0.5*(a+b+c); area=sqrt(s*(s-a)*(s-b)*(s-c)); printf(%f,area); return 0; } 2、主程序: // s.cpp : Defines the entry point for the console application. // #include stdafx.h #include stdio.h #include math.h int main(int argc, char* argv[]) { float r,h; scanf(%f%f,r,h); printf(The circumferential is %.2f\n.,2*3.14*r); printf(The acreage of the circle is %.2f\n.,3.14*r*r); printf(The acreage of the surface is %.2f\n.,4*3.14*r*r); printf(The volume of the ball is %.2f\n.,4/3*3.14*r*r*r); printf(The volume of the cylinder is %.2f\n.,3.14*r*r*h); return 0; } 3、主程序: // h.cpp : Defines the entry point for the console application. // #include stdafx.h #include stdio.h #include math.h int main(int argc, char* argv[]) { char c1,c2; c1=getchar(); c2=getchar(); p

文档评论(0)

liwenhua00 + 关注
实名认证
文档贡献者

该用户很懒,什么也没介绍

1亿VIP精品文档

相关文档