C语言
-
C语言指定行列打印字符-C语言基础教程实例源码|
C语言指定行列打印字符 /* showchar2.c -- prints characters in rows and columns */ #include stdio.h void display ( char cr , int lines , int width ); int main ( void ) { int...
-
C语言混合数字和字符输入-C语言基础教程实例源码|
C语言混合数字和字符输入 /* showchar1.c -- program with a BIG I/O problem */ #include stdio.h void display ( char cr , int lines , int width ); int main ( void ) { int ch ...
-
C语言使用缓冲区实例-C语言基础教程实例源码|
C语言使用缓冲区实例 /* guess.c -- an inefficient and faulty number-guesser */ #include stdio.h int main ( void ) { int guess = 1 ; printf ( Pick an integer from 1 to 100. I...
-
C实例加法操作-C语言实例教程|
C实例 加法操作 #include stdio.h int main () { int op1 , op2 , sum ; // variable declaration op1 = 5 ; // variable definition op2 = 3 ; sum = op1 + op2 ; // addition operation ...
-
C语言文件实例-C语言基础教程实例源码|
C语言文件实例 // file_eof.c --open a file and display it #include stdio.h #include stdlib.h // for exit() int main () { int ch ; FILE * fp ; char fname [ 50 ]; // to hold the ...
-
C实例双精度变量-C语言实例教程|
C实例 双精度变量 #include stdio.h int main () { double d ; // double precision variable declaration d = 12.001234 ; // defining double precision variable printf ( value of d ...
-
C语言判断文件结尾实例-C语言基础教程实例源码|
C语言判断文件结尾实例 /* echo_eof.c -- repeats input to end of file */ #include stdio.h int main ( void ) { int ch ; while (( ch = getchar ()) != EOF ) putchar ( ch ); ret...
-
C实例浮点变量-C语言实例教程|
C实例 浮点变量 #include stdio.h int main () { float f ; // floating point variable declaration f = 12.001234 ; // defining float variable printf ( value of f is %f , f ); retu...
-
C实例数字变量-C语言实例教程|
C实例 数字变量 #include stdio.h int main () { int i ; // integer variable declaration i = 123 ; // defining integer variable printf ( value of i is %d , i ); return 0 ; }...
-
C实例字符变量-C语言实例教程|
C实例 字符变量 #include stdio.h int main () { char c ; // char variable declaration c = A ; // defining a char variable printf ( value of c is %c , c ); return 0 ; }...
-
C实例HelloWorld程序-C语言实例教程|
C 实例 Hello World 程序 #include stdio.h int main () { printf ( Hello World! ); return 0 ; }...
-
计算机编程访问存储值-C语言实例教程|
计算机编程 访问存储值 #include stdio.h int main () { int a ; int b ; a = 10 ; b = 20 ; printf ( Value of a = %d , a ); printf ( Value of b = %d , b ); }...
-
计算机编程读文件-C语言实例教程|
计算机编程 读文件 #include stdio.h int main () { FILE * fp ; char buff [ 255 ]; fp = fopen ( /tmp/test.txt , r ); fscanf ( fp , %s , buff ); printf ( 1 : %s , buff ); fgets ...
-
计算机编程写文件-C语言实例教程|
计算机编程 写文件 #include stdio.h int main () { FILE * fp ; fp = fopen ( /tmp/test.txt , w+ ); fprintf ( fp , This is testing for fprintf... ); fputs ( This is testing for ...
-
C语言单字符IO实例-C语言基础教程实例源码|
C语言单字符IO实例 /* echo.c -- repeats input */ #include stdio.h int main ( void ) { char ch ; while (( ch = getchar ()) != # ) putchar ( ch ); return 0 ; }...
-
计算机编程调用函数-C语言实例教程|
计算机编程 调用函数 #include stdio.h int getMax ( int set [] ) { int i , max ; max = set [ 0 ]; i = 1 ; while ( i 5 ) { if ( max set [ i ] ) { max = set [ i ]; } i = i + 1 ...
-
C语言多重标签实例-C语言基础教程实例源码|
C语言多重标签实例 // vowels.c -- uses multiple labels #include stdio.h int main ( void ) { char ch ; int a_ct , e_ct , i_ct , o_ct , u_ct ; a_ct = e_ct = i_ct = o_ct = u_ct ...
-
C语言多重选择实例-C语言基础教程实例源码|
C语言多重选择实例 /* animals.c -- uses a switch statement */ #include stdio.h #include ctype.h int main ( void ) { char ch ; printf ( Give me a letter of the alphabet, and I...
-
C语言break实例-C语言基础教程实例源码|
C语言break实例 /* break.c -- uses break to exit a loop */ #include stdio.h int main ( void ) { float length , width ; printf ( Enter the length of the rectangle: ); while ( scan...
-
C语言continue实例-C语言基础教程实例源码|
C语言continue实例 /* skippart.c -- uses continue to skip part of loop */ #include stdio.h int main ( void ) { const float MIN = 0.0f ; const float MAX = 100.0f ; float score ; f...