文件名称:exercise 5 BUPT
介绍说明--下载内容来自于网络,使用问题请自行百度
C exercise
Exercise 5: ‘for’ and ‘do … while” repetition statements
1. Write a program which uses a do/while loop to print out the first 10 powers of 2 other than 0 (ie. it prints out the values of 21, 22, ..., 210). Use a for loop to do the same.
2. The constant can be calculated by the infinite series:
= 4 - 4/3 + 4/5 - 4/7 + 4/9 - 4/11 +....
Write a C program that uses a do/while loop to calculate using the series. The program should ask the user how many terms in the series should be used. Thus if the user enters ‘3’, then the program should calculate as being 4 - 4/3 + 4/5.
Exercise 5: ‘for’ and ‘do … while” repetition statements
1. Write a program which uses a do/while loop to print out the first 10 powers of 2 other than 0 (ie. it prints out the values of 21, 22, ..., 210). Use a for loop to do the same.
2. The constant can be calculated by the infinite series:
= 4 - 4/3 + 4/5 - 4/7 + 4/9 - 4/11 +....
Write a C program that uses a do/while loop to calculate using the series. The program should ask the user how many terms in the series should be used. Thus if the user enters ‘3’, then the program should calculate as being 4 - 4/3 + 4/5.
相关搜索: c 语言
(系统自动生成,下载前可以参看下载内容)
下载文件列表
压缩包 : 2019213189-EX05.zip 列表 2019213189-EX05/ 2019213189-EX05/2019213189-EX05-01.cpp 2019213189-EX05/2019213189-EX05-03.cpp 2019213189-EX05/2019213189-EX05-02.cpp 2019213189-EX05/.DS_Store __MACOSX/2019213189-EX05/._.DS_Store 2019213189-EX05/2019213189-EX05-04.cpp
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.