c how to program 习题3.28

c how to program 习题3.28

运行结果: C语言代码: /* c how to program 习题3.28 */ #include <stdio.h> // function main begins program execution int main( void ) { //初始化变量count为0 int count = 0; //当count少于10执行循环 whil ...

c how to program 习题3.27

c how to program 习题3.27

运行结果: C语言代码: /* c how to program 习题3.27 */ // Fig. 3.10: fig03_10.c // Analysis of examination results #include <stdio.h> // function main begins program execution int main( void ) { // initialize var ...

c how to program 习题3.26

c how to program 习题3.26

运行结果: C语言代码: /* c how to program 习题3.26 */ #include <stdio.h> #include <stdlib.h> int main() { //分别定义变量 int counter = 0; unsigned int number, largest=0, secondLargest=0; //当coun ...

c how to program 习题3.25

c how to program 习题3.25

运行结果: C语言代码: /* c how to program 习题3.25 */ #include <stdio.h> #include <stdlib.h> int main() { //分别定义记数变量i和j int i = 0, j; //分别娄底列和行变量m和n int m = 0, n; //打印表 ...

c how to program 习题3.24

c how to program 习题3.24

运行结果: C语言代码: /* c how to program 习题3.24 */ #include <stdio.h> #include <stdlib.h> int main() { //分别定义变量 int i = 0, j; int n; //打印表格格式 printf("N\t10*N\t100*N\t1000*N\n\n ...

c how to program 习题3.23

c how to program 习题3.23

运行结果: C语言代码: /* c how to program 习题3.23 */ #include <stdio.h> #include <stdlib.h> int main() { //分别定义变量 int counter = 0; int number = 0, largest=0; //当counter++少于10,进入循环 ...

c how to program 习题3.22

c how to program 习题3.22

运行结果: C语言代码: /* c how to program 习题3.22 */ #include <stdio.h> #include <stdlib.h> int main() { //分别定义变量 int number = 0; while(number < 10){ printf("%d ", ++number); ...

c how to program 习题3.21

c how to program 习题3.21

运行结果: C语言代码: /* c how to program 习题3.21 */ #include <stdio.h> #include <stdlib.h> int main() { //分别定义变量 int number; //获取number的值 printf("Enter a number: "); scanf("%d", ...

c how to program 习题3.20

c how to program 习题3.20

运行结果: C语言代码: /* c how to program 习题3.20 */ #include <stdio.h> #include <stdlib.h> int main() { //分别定义变量 double houers, rate, salary; //获取第一个员工的工作时间 printf("Enter num ...

c how to program 习题3.19

c how to program 习题3.19

运行结果: C程序代码: /* c how to program 习题3.19 */ #include <stdio.h> #include <stdlib.h> int main() { //分别定义变量 double interest, principal, rate; int days; //获取第一次的贷款金额 ...