funct.c
来自「C源码集」· C语言 代码 · 共 34 行
C
34 行
#include <stdio.h>/* prototype bit - must have!! Tells the compiler how print_table works*/int print_table(double, double, double);int main (void){ int how_many; double end = 50.0; how_many = print_table(1.0, end, 3); /* how_many becomes value lines had in function */ printf("number of lines: %i\n", how_many); printf("/nPress <Enter> to continue/n"); getchar(); // makes program wait for a keypress print_table(end, 200, 15); /* don't need to use the returned value */ return 0;}int print_table(double start, double end, double step){ double d; int lines = 1; printf("Celcius\tFarenheight\n"); for (d = start; d<= end; d += step, lines++) printf("%.1lf\t%.1lf\n", d, d * 1.8 + 32); return lines;}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?